{-# 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.TagUser
(
TagUser (..),
newTagUser,
tagUser_userName,
tagUser_tags,
TagUserResponse (..),
newTagUserResponse,
)
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 TagUser = TagUser'
{
TagUser -> Text
userName :: Prelude.Text,
TagUser -> [Tag]
tags :: [Tag]
}
deriving (TagUser -> TagUser -> Bool
(TagUser -> TagUser -> Bool)
-> (TagUser -> TagUser -> Bool) -> Eq TagUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagUser -> TagUser -> Bool
$c/= :: TagUser -> TagUser -> Bool
== :: TagUser -> TagUser -> Bool
$c== :: TagUser -> TagUser -> Bool
Prelude.Eq, ReadPrec [TagUser]
ReadPrec TagUser
Int -> ReadS TagUser
ReadS [TagUser]
(Int -> ReadS TagUser)
-> ReadS [TagUser]
-> ReadPrec TagUser
-> ReadPrec [TagUser]
-> Read TagUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagUser]
$creadListPrec :: ReadPrec [TagUser]
readPrec :: ReadPrec TagUser
$creadPrec :: ReadPrec TagUser
readList :: ReadS [TagUser]
$creadList :: ReadS [TagUser]
readsPrec :: Int -> ReadS TagUser
$creadsPrec :: Int -> ReadS TagUser
Prelude.Read, Int -> TagUser -> ShowS
[TagUser] -> ShowS
TagUser -> String
(Int -> TagUser -> ShowS)
-> (TagUser -> String) -> ([TagUser] -> ShowS) -> Show TagUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagUser] -> ShowS
$cshowList :: [TagUser] -> ShowS
show :: TagUser -> String
$cshow :: TagUser -> String
showsPrec :: Int -> TagUser -> ShowS
$cshowsPrec :: Int -> TagUser -> ShowS
Prelude.Show, (forall x. TagUser -> Rep TagUser x)
-> (forall x. Rep TagUser x -> TagUser) -> Generic TagUser
forall x. Rep TagUser x -> TagUser
forall x. TagUser -> Rep TagUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagUser x -> TagUser
$cfrom :: forall x. TagUser -> Rep TagUser x
Prelude.Generic)
newTagUser ::
Prelude.Text ->
TagUser
newTagUser :: Text -> TagUser
newTagUser Text
pUserName_ =
TagUser' :: Text -> [Tag] -> TagUser
TagUser'
{ $sel:userName:TagUser' :: Text
userName = Text
pUserName_,
$sel:tags:TagUser' :: [Tag]
tags = [Tag]
forall a. Monoid a => a
Prelude.mempty
}
tagUser_userName :: Lens.Lens' TagUser Prelude.Text
tagUser_userName :: (Text -> f Text) -> TagUser -> f TagUser
tagUser_userName = (TagUser -> Text)
-> (TagUser -> Text -> TagUser) -> Lens TagUser TagUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagUser' {Text
userName :: Text
$sel:userName:TagUser' :: TagUser -> Text
userName} -> Text
userName) (\s :: TagUser
s@TagUser' {} Text
a -> TagUser
s {$sel:userName:TagUser' :: Text
userName = Text
a} :: TagUser)
tagUser_tags :: Lens.Lens' TagUser [Tag]
tagUser_tags :: ([Tag] -> f [Tag]) -> TagUser -> f TagUser
tagUser_tags = (TagUser -> [Tag])
-> (TagUser -> [Tag] -> TagUser)
-> Lens TagUser TagUser [Tag] [Tag]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagUser' {[Tag]
tags :: [Tag]
$sel:tags:TagUser' :: TagUser -> [Tag]
tags} -> [Tag]
tags) (\s :: TagUser
s@TagUser' {} [Tag]
a -> TagUser
s {$sel:tags:TagUser' :: [Tag]
tags = [Tag]
a} :: TagUser) (([Tag] -> f [Tag]) -> TagUser -> f TagUser)
-> (([Tag] -> f [Tag]) -> [Tag] -> f [Tag])
-> ([Tag] -> f [Tag])
-> TagUser
-> f TagUser
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 Core.AWSRequest TagUser where
type AWSResponse TagUser = TagUserResponse
request :: TagUser -> Request TagUser
request = Service -> TagUser -> Request TagUser
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy TagUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TagUser)))
response = AWSResponse TagUser
-> Logger
-> Service
-> Proxy TagUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TagUser)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse TagUser
TagUserResponse
TagUserResponse'
instance Prelude.Hashable TagUser
instance Prelude.NFData TagUser
instance Core.ToHeaders TagUser where
toHeaders :: TagUser -> [Header]
toHeaders = [Header] -> TagUser -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath TagUser where
toPath :: TagUser -> ByteString
toPath = ByteString -> TagUser -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery TagUser where
toQuery :: TagUser -> QueryString
toQuery TagUser' {[Tag]
Text
tags :: [Tag]
userName :: Text
$sel:tags:TagUser' :: TagUser -> [Tag]
$sel:userName:TagUser' :: TagUser -> 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
"TagUser" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
userName,
ByteString
"Tags" ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Tag]
tags
]
data TagUserResponse = TagUserResponse'
{
}
deriving (TagUserResponse -> TagUserResponse -> Bool
(TagUserResponse -> TagUserResponse -> Bool)
-> (TagUserResponse -> TagUserResponse -> Bool)
-> Eq TagUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagUserResponse -> TagUserResponse -> Bool
$c/= :: TagUserResponse -> TagUserResponse -> Bool
== :: TagUserResponse -> TagUserResponse -> Bool
$c== :: TagUserResponse -> TagUserResponse -> Bool
Prelude.Eq, ReadPrec [TagUserResponse]
ReadPrec TagUserResponse
Int -> ReadS TagUserResponse
ReadS [TagUserResponse]
(Int -> ReadS TagUserResponse)
-> ReadS [TagUserResponse]
-> ReadPrec TagUserResponse
-> ReadPrec [TagUserResponse]
-> Read TagUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagUserResponse]
$creadListPrec :: ReadPrec [TagUserResponse]
readPrec :: ReadPrec TagUserResponse
$creadPrec :: ReadPrec TagUserResponse
readList :: ReadS [TagUserResponse]
$creadList :: ReadS [TagUserResponse]
readsPrec :: Int -> ReadS TagUserResponse
$creadsPrec :: Int -> ReadS TagUserResponse
Prelude.Read, Int -> TagUserResponse -> ShowS
[TagUserResponse] -> ShowS
TagUserResponse -> String
(Int -> TagUserResponse -> ShowS)
-> (TagUserResponse -> String)
-> ([TagUserResponse] -> ShowS)
-> Show TagUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagUserResponse] -> ShowS
$cshowList :: [TagUserResponse] -> ShowS
show :: TagUserResponse -> String
$cshow :: TagUserResponse -> String
showsPrec :: Int -> TagUserResponse -> ShowS
$cshowsPrec :: Int -> TagUserResponse -> ShowS
Prelude.Show, (forall x. TagUserResponse -> Rep TagUserResponse x)
-> (forall x. Rep TagUserResponse x -> TagUserResponse)
-> Generic TagUserResponse
forall x. Rep TagUserResponse x -> TagUserResponse
forall x. TagUserResponse -> Rep TagUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagUserResponse x -> TagUserResponse
$cfrom :: forall x. TagUserResponse -> Rep TagUserResponse x
Prelude.Generic)
newTagUserResponse ::
TagUserResponse
newTagUserResponse :: TagUserResponse
newTagUserResponse = TagUserResponse
TagUserResponse'
instance Prelude.NFData TagUserResponse