{-# 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_isTruncated,
listPolicyTagsResponse_marker,
listPolicyTagsResponse_httpStatus,
listPolicyTagsResponse_tags,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
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
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]
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
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. 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'
{ $sel:marker:ListPolicyTags' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListPolicyTags' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:policyArn:ListPolicyTags' :: Text
policyArn = Text
pPolicyArn_
}
listPolicyTags_marker :: Lens.Lens' ListPolicyTags (Prelude.Maybe Prelude.Text)
listPolicyTags_marker :: Lens' ListPolicyTags (Maybe Text)
listPolicyTags_marker = 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 :: Lens' ListPolicyTags (Maybe Natural)
listPolicyTags_maxItems = 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 :: Lens' ListPolicyTags Text
listPolicyTags_policyArn = 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 :: (Service -> Service) -> ListPolicyTags -> Request ListPolicyTags
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListPolicyTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPolicyTags)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ListPolicyTagsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Bool -> Maybe Text -> Int -> [Tag] -> ListPolicyTagsResponse
ListPolicyTagsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsTruncated")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Tags"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
)
)
instance Prelude.Hashable ListPolicyTags where
hashWithSalt :: Int -> ListPolicyTags -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyArn
instance Prelude.NFData ListPolicyTags where
rnf :: ListPolicyTags -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyArn
instance Data.ToHeaders ListPolicyTags where
toHeaders :: ListPolicyTags -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListPolicyTags where
toPath :: ListPolicyTags -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListPolicyTags" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxItems,
ByteString
"PolicyArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policyArn
]
data ListPolicyTagsResponse = ListPolicyTagsResponse'
{
ListPolicyTagsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
ListPolicyTagsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListPolicyTagsResponse -> Int
httpStatus :: Prelude.Int,
ListPolicyTagsResponse -> [Tag]
tags :: [Tag]
}
deriving (ListPolicyTagsResponse -> ListPolicyTagsResponse -> Bool
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]
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
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. 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'
{ $sel:isTruncated:ListPolicyTagsResponse' :: Maybe Bool
isTruncated =
forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListPolicyTagsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPolicyTagsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:tags:ListPolicyTagsResponse' :: [Tag]
tags = forall a. Monoid a => a
Prelude.mempty
}
listPolicyTagsResponse_isTruncated :: Lens.Lens' ListPolicyTagsResponse (Prelude.Maybe Prelude.Bool)
listPolicyTagsResponse_isTruncated :: Lens' ListPolicyTagsResponse (Maybe Bool)
listPolicyTagsResponse_isTruncated = 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_marker :: Lens.Lens' ListPolicyTagsResponse (Prelude.Maybe Prelude.Text)
listPolicyTagsResponse_marker :: Lens' ListPolicyTagsResponse (Maybe Text)
listPolicyTagsResponse_marker = 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_httpStatus :: Lens.Lens' ListPolicyTagsResponse Prelude.Int
listPolicyTagsResponse_httpStatus :: Lens' ListPolicyTagsResponse Int
listPolicyTagsResponse_httpStatus = 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 :: Lens' ListPolicyTagsResponse [Tag]
listPolicyTagsResponse_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListPolicyTagsResponse where
rnf :: ListPolicyTagsResponse -> ()
rnf ListPolicyTagsResponse' {Int
[Tag]
Maybe Bool
Maybe Text
tags :: [Tag]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:tags:ListPolicyTagsResponse' :: ListPolicyTagsResponse -> [Tag]
$sel:httpStatus:ListPolicyTagsResponse' :: ListPolicyTagsResponse -> Int
$sel:marker:ListPolicyTagsResponse' :: ListPolicyTagsResponse -> Maybe Text
$sel:isTruncated:ListPolicyTagsResponse' :: ListPolicyTagsResponse -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Tag]
tags