{-# 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.ListPolicyTags
-- 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 customer managed
-- policy. 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/.
module Amazonka.IAM.ListPolicyTags
  ( -- * Creating a Request
    ListPolicyTags (..),
    newListPolicyTags,

    -- * Request Lenses
    listPolicyTags_marker,
    listPolicyTags_maxItems,
    listPolicyTags_policyArn,

    -- * Destructuring the Response
    ListPolicyTagsResponse (..),
    newListPolicyTagsResponse,

    -- * Response Lenses
    listPolicyTagsResponse_marker,
    listPolicyTagsResponse_isTruncated,
    listPolicyTagsResponse_httpStatus,
    listPolicyTagsResponse_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:/ 'newListPolicyTags' smart constructor.
data ListPolicyTags = ListPolicyTags'
  { -- | 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.
    ListPolicyTags -> 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.
    ListPolicyTags -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the IAM customer managed policy 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: _+=,.\@-
    ListPolicyTags -> Text
policyArn :: Prelude.Text
  }
  deriving (ListPolicyTags -> ListPolicyTags -> Bool
(ListPolicyTags -> ListPolicyTags -> Bool)
-> (ListPolicyTags -> ListPolicyTags -> Bool) -> Eq ListPolicyTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPolicyTags -> ListPolicyTags -> Bool
$c/= :: ListPolicyTags -> ListPolicyTags -> Bool
== :: ListPolicyTags -> ListPolicyTags -> Bool
$c== :: ListPolicyTags -> ListPolicyTags -> Bool
Prelude.Eq, ReadPrec [ListPolicyTags]
ReadPrec ListPolicyTags
Int -> ReadS ListPolicyTags
ReadS [ListPolicyTags]
(Int -> ReadS ListPolicyTags)
-> ReadS [ListPolicyTags]
-> ReadPrec ListPolicyTags
-> ReadPrec [ListPolicyTags]
-> Read ListPolicyTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPolicyTags]
$creadListPrec :: ReadPrec [ListPolicyTags]
readPrec :: ReadPrec ListPolicyTags
$creadPrec :: ReadPrec ListPolicyTags
readList :: ReadS [ListPolicyTags]
$creadList :: ReadS [ListPolicyTags]
readsPrec :: Int -> ReadS ListPolicyTags
$creadsPrec :: Int -> ReadS ListPolicyTags
Prelude.Read, Int -> ListPolicyTags -> ShowS
[ListPolicyTags] -> ShowS
ListPolicyTags -> String
(Int -> ListPolicyTags -> ShowS)
-> (ListPolicyTags -> String)
-> ([ListPolicyTags] -> ShowS)
-> Show ListPolicyTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPolicyTags] -> ShowS
$cshowList :: [ListPolicyTags] -> ShowS
show :: ListPolicyTags -> String
$cshow :: ListPolicyTags -> String
showsPrec :: Int -> ListPolicyTags -> ShowS
$cshowsPrec :: Int -> ListPolicyTags -> ShowS
Prelude.Show, (forall x. ListPolicyTags -> Rep ListPolicyTags x)
-> (forall x. Rep ListPolicyTags x -> ListPolicyTags)
-> Generic ListPolicyTags
forall x. Rep ListPolicyTags x -> ListPolicyTags
forall x. ListPolicyTags -> Rep ListPolicyTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPolicyTags x -> ListPolicyTags
$cfrom :: forall x. ListPolicyTags -> Rep ListPolicyTags x
Prelude.Generic)

-- |
-- Create a value of 'ListPolicyTags' 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', 'listPolicyTags_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', 'listPolicyTags_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.
--
-- 'policyArn', 'listPolicyTags_policyArn' - The ARN of the IAM customer managed policy 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: _+=,.\@-
newListPolicyTags ::
  -- | 'policyArn'
  Prelude.Text ->
  ListPolicyTags
newListPolicyTags :: Text -> ListPolicyTags
newListPolicyTags Text
pPolicyArn_ =
  ListPolicyTags' :: Maybe Text -> Maybe Natural -> Text -> ListPolicyTags
ListPolicyTags'
    { $sel:marker:ListPolicyTags' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListPolicyTags' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:policyArn:ListPolicyTags' :: Text
policyArn = Text
pPolicyArn_
    }

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

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

-- | The ARN of the IAM customer managed policy 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: _+=,.\@-
listPolicyTags_policyArn :: Lens.Lens' ListPolicyTags Prelude.Text
listPolicyTags_policyArn :: (Text -> f Text) -> ListPolicyTags -> f ListPolicyTags
listPolicyTags_policyArn = (ListPolicyTags -> Text)
-> (ListPolicyTags -> Text -> ListPolicyTags)
-> Lens ListPolicyTags ListPolicyTags Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPolicyTags' {Text
policyArn :: Text
$sel:policyArn:ListPolicyTags' :: ListPolicyTags -> Text
policyArn} -> Text
policyArn) (\s :: ListPolicyTags
s@ListPolicyTags' {} Text
a -> ListPolicyTags
s {$sel:policyArn:ListPolicyTags' :: Text
policyArn = Text
a} :: ListPolicyTags)

instance Core.AWSRequest ListPolicyTags where
  type
    AWSResponse ListPolicyTags =
      ListPolicyTagsResponse
  request :: ListPolicyTags -> Request ListPolicyTags
request = Service -> ListPolicyTags -> Request ListPolicyTags
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPolicyTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPolicyTags)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListPolicyTags))
-> Logger
-> Service
-> Proxy ListPolicyTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPolicyTags)))
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
"ListPolicyTagsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe Bool -> Int -> [Tag] -> ListPolicyTagsResponse
ListPolicyTagsResponse'
            (Maybe Text
 -> Maybe Bool -> Int -> [Tag] -> ListPolicyTagsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Bool -> Int -> [Tag] -> ListPolicyTagsResponse)
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] -> ListPolicyTagsResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> [Tag] -> ListPolicyTagsResponse)
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] -> ListPolicyTagsResponse)
-> Either String Int
-> Either String ([Tag] -> ListPolicyTagsResponse)
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] -> ListPolicyTagsResponse)
-> Either String [Tag] -> Either String ListPolicyTagsResponse
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 ListPolicyTags

instance Prelude.NFData ListPolicyTags

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

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

instance Core.ToQuery ListPolicyTags where
  toQuery :: ListPolicyTags -> QueryString
toQuery ListPolicyTags' {Maybe Natural
Maybe Text
Text
policyArn :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:policyArn:ListPolicyTags' :: ListPolicyTags -> Text
$sel:maxItems:ListPolicyTags' :: ListPolicyTags -> Maybe Natural
$sel:marker:ListPolicyTags' :: ListPolicyTags -> 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
"ListPolicyTags" :: 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
"PolicyArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyArn
      ]

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

-- |
-- Create a value of 'ListPolicyTagsResponse' 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', 'listPolicyTagsResponse_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', 'listPolicyTagsResponse_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', 'listPolicyTagsResponse_httpStatus' - The response's http status code.
--
-- 'tags', 'listPolicyTagsResponse_tags' - The list of tags that are currently attached to the IAM customer managed
-- policy. 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.
newListPolicyTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPolicyTagsResponse
newListPolicyTagsResponse :: Int -> ListPolicyTagsResponse
newListPolicyTagsResponse Int
pHttpStatus_ =
  ListPolicyTagsResponse' :: Maybe Text -> Maybe Bool -> Int -> [Tag] -> ListPolicyTagsResponse
ListPolicyTagsResponse'
    { $sel:marker:ListPolicyTagsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListPolicyTagsResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPolicyTagsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:tags:ListPolicyTagsResponse' :: [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.
listPolicyTagsResponse_marker :: Lens.Lens' ListPolicyTagsResponse (Prelude.Maybe Prelude.Text)
listPolicyTagsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListPolicyTagsResponse -> f ListPolicyTagsResponse
listPolicyTagsResponse_marker = (ListPolicyTagsResponse -> Maybe Text)
-> (ListPolicyTagsResponse -> Maybe Text -> ListPolicyTagsResponse)
-> Lens
     ListPolicyTagsResponse
     ListPolicyTagsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPolicyTagsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListPolicyTagsResponse' :: ListPolicyTagsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListPolicyTagsResponse
s@ListPolicyTagsResponse' {} Maybe Text
a -> ListPolicyTagsResponse
s {$sel:marker:ListPolicyTagsResponse' :: Maybe Text
marker = Maybe Text
a} :: ListPolicyTagsResponse)

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

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

-- | The list of tags that are currently attached to the IAM customer managed
-- policy. 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.
listPolicyTagsResponse_tags :: Lens.Lens' ListPolicyTagsResponse [Tag]
listPolicyTagsResponse_tags :: ([Tag] -> f [Tag])
-> ListPolicyTagsResponse -> f ListPolicyTagsResponse
listPolicyTagsResponse_tags = (ListPolicyTagsResponse -> [Tag])
-> (ListPolicyTagsResponse -> [Tag] -> ListPolicyTagsResponse)
-> Lens ListPolicyTagsResponse ListPolicyTagsResponse [Tag] [Tag]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPolicyTagsResponse' {[Tag]
tags :: [Tag]
$sel:tags:ListPolicyTagsResponse' :: ListPolicyTagsResponse -> [Tag]
tags} -> [Tag]
tags) (\s :: ListPolicyTagsResponse
s@ListPolicyTagsResponse' {} [Tag]
a -> ListPolicyTagsResponse
s {$sel:tags:ListPolicyTagsResponse' :: [Tag]
tags = [Tag]
a} :: ListPolicyTagsResponse) (([Tag] -> f [Tag])
 -> ListPolicyTagsResponse -> f ListPolicyTagsResponse)
-> (([Tag] -> f [Tag]) -> [Tag] -> f [Tag])
-> ([Tag] -> f [Tag])
-> ListPolicyTagsResponse
-> f ListPolicyTagsResponse
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 ListPolicyTagsResponse