module Network.AWS.IAM.GetInstanceProfile
(
getInstanceProfile
, GetInstanceProfile
, gipInstanceProfileName
, getInstanceProfileResponse
, GetInstanceProfileResponse
, giprsStatus
, giprsInstanceProfile
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
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 Sv GetInstanceProfile = IAM
type Rs GetInstanceProfile =
GetInstanceProfileResponse
request = postQuery
response
= receiveXMLWrapper "GetInstanceProfileResult"
(\ s h x ->
GetInstanceProfileResponse' <$>
(pure (fromEnum s)) <*> (x .@ "InstanceProfile"))
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'
{ _giprsStatus :: !Int
, _giprsInstanceProfile :: !InstanceProfile
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getInstanceProfileResponse
:: Int
-> InstanceProfile
-> GetInstanceProfileResponse
getInstanceProfileResponse pStatus_ pInstanceProfile_ =
GetInstanceProfileResponse'
{ _giprsStatus = pStatus_
, _giprsInstanceProfile = pInstanceProfile_
}
giprsStatus :: Lens' GetInstanceProfileResponse Int
giprsStatus = lens _giprsStatus (\ s a -> s{_giprsStatus = a});
giprsInstanceProfile :: Lens' GetInstanceProfileResponse InstanceProfile
giprsInstanceProfile = lens _giprsInstanceProfile (\ s a -> s{_giprsInstanceProfile = a});