{-# 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 #-}
module Amazonka.IAM.ListPolicyTags
(
ListPolicyTags (..),
newListPolicyTags,
listPolicyTags_marker,
listPolicyTags_maxItems,
listPolicyTags_policyArn,
ListPolicyTagsResponse (..),
newListPolicyTagsResponse,
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
data ListPolicyTags = ListPolicyTags'
{
ListPolicyTags -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListPolicyTags -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
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)
newListPolicyTags ::
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_
}
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)
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)
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
]
data ListPolicyTagsResponse = ListPolicyTagsResponse'
{
ListPolicyTagsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListPolicyTagsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
ListPolicyTagsResponse -> Int
httpStatus :: Prelude.Int,
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)
newListPolicyTagsResponse ::
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
}
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)
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)
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)
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