{-# 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.ListUserTags
(
ListUserTags (..),
newListUserTags,
listUserTags_marker,
listUserTags_maxItems,
listUserTags_userName,
ListUserTagsResponse (..),
newListUserTagsResponse,
listUserTagsResponse_isTruncated,
listUserTagsResponse_marker,
listUserTagsResponse_httpStatus,
listUserTagsResponse_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 ListUserTags = ListUserTags'
{
ListUserTags -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListUserTags -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
ListUserTags -> Text
userName :: Prelude.Text
}
deriving (ListUserTags -> ListUserTags -> Bool
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]
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
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. 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)
newListUserTags ::
Prelude.Text ->
ListUserTags
newListUserTags :: Text -> ListUserTags
newListUserTags Text
pUserName_ =
ListUserTags'
{ $sel:marker:ListUserTags' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListUserTags' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:userName:ListUserTags' :: Text
userName = Text
pUserName_
}
listUserTags_marker :: Lens.Lens' ListUserTags (Prelude.Maybe Prelude.Text)
listUserTags_marker :: Lens' ListUserTags (Maybe Text)
listUserTags_marker = 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)
listUserTags_maxItems :: Lens.Lens' ListUserTags (Prelude.Maybe Prelude.Natural)
listUserTags_maxItems :: Lens' ListUserTags (Maybe Natural)
listUserTags_maxItems = 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)
listUserTags_userName :: Lens.Lens' ListUserTags Prelude.Text
listUserTags_userName :: Lens' ListUserTags Text
listUserTags_userName = 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
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListUserTags
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserTagsResponse (Maybe Bool)
listUserTagsResponse_isTruncated
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. Maybe a -> Bool
Prelude.isNothing
( AWSResponse ListUserTags
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserTagsResponse (Maybe Text)
listUserTagsResponse_marker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListUserTags
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListUserTags (Maybe Text)
listUserTags_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUserTags
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserTagsResponse (Maybe Text)
listUserTagsResponse_marker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListUserTags where
type AWSResponse ListUserTags = ListUserTagsResponse
request :: (Service -> Service) -> ListUserTags -> Request ListUserTags
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 ListUserTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserTags)))
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
"ListUserTagsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Bool -> Maybe Text -> Int -> [Tag] -> ListUserTagsResponse
ListUserTagsResponse'
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 ListUserTags where
hashWithSalt :: Int -> ListUserTags -> Int
hashWithSalt Int
_salt 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
..} =
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
userName
instance Prelude.NFData ListUserTags where
rnf :: ListUserTags -> ()
rnf 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
..} =
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
userName
instance Data.ToHeaders ListUserTags where
toHeaders :: ListUserTags -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListUserTags where
toPath :: ListUserTags -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListUserTags" :: 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
"UserName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
userName
]
data ListUserTagsResponse = ListUserTagsResponse'
{
ListUserTagsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
ListUserTagsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListUserTagsResponse -> Int
httpStatus :: Prelude.Int,
ListUserTagsResponse -> [Tag]
tags :: [Tag]
}
deriving (ListUserTagsResponse -> ListUserTagsResponse -> Bool
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]
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
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. 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)
newListUserTagsResponse ::
Prelude.Int ->
ListUserTagsResponse
newListUserTagsResponse :: Int -> ListUserTagsResponse
newListUserTagsResponse Int
pHttpStatus_ =
ListUserTagsResponse'
{ $sel:isTruncated:ListUserTagsResponse' :: Maybe Bool
isTruncated =
forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListUserTagsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListUserTagsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:tags:ListUserTagsResponse' :: [Tag]
tags = forall a. Monoid a => a
Prelude.mempty
}
listUserTagsResponse_isTruncated :: Lens.Lens' ListUserTagsResponse (Prelude.Maybe Prelude.Bool)
listUserTagsResponse_isTruncated :: Lens' ListUserTagsResponse (Maybe Bool)
listUserTagsResponse_isTruncated = 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)
listUserTagsResponse_marker :: Lens.Lens' ListUserTagsResponse (Prelude.Maybe Prelude.Text)
listUserTagsResponse_marker :: Lens' ListUserTagsResponse (Maybe Text)
listUserTagsResponse_marker = 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)
listUserTagsResponse_httpStatus :: Lens.Lens' ListUserTagsResponse Prelude.Int
listUserTagsResponse_httpStatus :: Lens' ListUserTagsResponse Int
listUserTagsResponse_httpStatus = 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)
listUserTagsResponse_tags :: Lens.Lens' ListUserTagsResponse [Tag]
listUserTagsResponse_tags :: Lens' ListUserTagsResponse [Tag]
listUserTagsResponse_tags = 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) 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 ListUserTagsResponse where
rnf :: ListUserTagsResponse -> ()
rnf ListUserTagsResponse' {Int
[Tag]
Maybe Bool
Maybe Text
tags :: [Tag]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:tags:ListUserTagsResponse' :: ListUserTagsResponse -> [Tag]
$sel:httpStatus:ListUserTagsResponse' :: ListUserTagsResponse -> Int
$sel:marker:ListUserTagsResponse' :: ListUserTagsResponse -> Maybe Text
$sel:isTruncated:ListUserTagsResponse' :: ListUserTagsResponse -> 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