module Network.AWS.IAM.GetInstanceProfile
(
getInstanceProfile
, GetInstanceProfile
, gipInstanceProfileName
, getInstanceProfileResponse
, GetInstanceProfileResponse
, giprsResponseStatus
, giprsInstanceProfile
) 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
newtype GetInstanceProfile = GetInstanceProfile'
{ _gipInstanceProfileName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getInstanceProfile
:: Text
-> GetInstanceProfile
getInstanceProfile pInstanceProfileName_ =
GetInstanceProfile'
{ _gipInstanceProfileName = pInstanceProfileName_
}
gipInstanceProfileName :: Lens' GetInstanceProfile Text
gipInstanceProfileName = lens _gipInstanceProfileName (\ s a -> s{_gipInstanceProfileName = a});
instance AWSRequest GetInstanceProfile where
type Rs GetInstanceProfile =
GetInstanceProfileResponse
request = postQuery iam
response
= receiveXMLWrapper "GetInstanceProfileResult"
(\ s h x ->
GetInstanceProfileResponse' <$>
(pure (fromEnum s)) <*> (x .@ "InstanceProfile"))
instance Hashable GetInstanceProfile
instance NFData GetInstanceProfile
instance ToHeaders GetInstanceProfile where
toHeaders = const mempty
instance ToPath GetInstanceProfile where
toPath = const "/"
instance ToQuery GetInstanceProfile where
toQuery GetInstanceProfile'{..}
= mconcat
["Action" =: ("GetInstanceProfile" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"InstanceProfileName" =: _gipInstanceProfileName]
data GetInstanceProfileResponse = GetInstanceProfileResponse'
{ _giprsResponseStatus :: !Int
, _giprsInstanceProfile :: !InstanceProfile
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getInstanceProfileResponse
:: Int
-> InstanceProfile
-> GetInstanceProfileResponse
getInstanceProfileResponse pResponseStatus_ pInstanceProfile_ =
GetInstanceProfileResponse'
{ _giprsResponseStatus = pResponseStatus_
, _giprsInstanceProfile = pInstanceProfile_
}
giprsResponseStatus :: Lens' GetInstanceProfileResponse Int
giprsResponseStatus = lens _giprsResponseStatus (\ s a -> s{_giprsResponseStatus = a});
giprsInstanceProfile :: Lens' GetInstanceProfileResponse InstanceProfile
giprsInstanceProfile = lens _giprsInstanceProfile (\ s a -> s{_giprsInstanceProfile = a});
instance NFData GetInstanceProfileResponse