{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.IAM.UpdateRoleDescription
(
updateRoleDescription
, UpdateRoleDescription
, urdRoleName
, urdDescription
, updateRoleDescriptionResponse
, UpdateRoleDescriptionResponse
, urdrsRole
, urdrsResponseStatus
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateRoleDescription = UpdateRoleDescription'
{ _urdRoleName :: !Text
, _urdDescription :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateRoleDescription
:: Text
-> Text
-> UpdateRoleDescription
updateRoleDescription pRoleName_ pDescription_ =
UpdateRoleDescription'
{_urdRoleName = pRoleName_, _urdDescription = pDescription_}
urdRoleName :: Lens' UpdateRoleDescription Text
urdRoleName = lens _urdRoleName (\ s a -> s{_urdRoleName = a})
urdDescription :: Lens' UpdateRoleDescription Text
urdDescription = lens _urdDescription (\ s a -> s{_urdDescription = a})
instance AWSRequest UpdateRoleDescription where
type Rs UpdateRoleDescription =
UpdateRoleDescriptionResponse
request = postQuery iam
response
= receiveXMLWrapper "UpdateRoleDescriptionResult"
(\ s h x ->
UpdateRoleDescriptionResponse' <$>
(x .@? "Role") <*> (pure (fromEnum s)))
instance Hashable UpdateRoleDescription where
instance NFData UpdateRoleDescription where
instance ToHeaders UpdateRoleDescription where
toHeaders = const mempty
instance ToPath UpdateRoleDescription where
toPath = const "/"
instance ToQuery UpdateRoleDescription where
toQuery UpdateRoleDescription'{..}
= mconcat
["Action" =: ("UpdateRoleDescription" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"RoleName" =: _urdRoleName,
"Description" =: _urdDescription]
data UpdateRoleDescriptionResponse = UpdateRoleDescriptionResponse'
{ _urdrsRole :: !(Maybe Role)
, _urdrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateRoleDescriptionResponse
:: Int
-> UpdateRoleDescriptionResponse
updateRoleDescriptionResponse pResponseStatus_ =
UpdateRoleDescriptionResponse'
{_urdrsRole = Nothing, _urdrsResponseStatus = pResponseStatus_}
urdrsRole :: Lens' UpdateRoleDescriptionResponse (Maybe Role)
urdrsRole = lens _urdrsRole (\ s a -> s{_urdrsRole = a})
urdrsResponseStatus :: Lens' UpdateRoleDescriptionResponse Int
urdrsResponseStatus = lens _urdrsResponseStatus (\ s a -> s{_urdrsResponseStatus = a})
instance NFData UpdateRoleDescriptionResponse where