module Network.AWS.IAM.CreateInstanceProfile
(
createInstanceProfile
, CreateInstanceProfile
, cipPath
, cipInstanceProfileName
, createInstanceProfileResponse
, CreateInstanceProfileResponse
, ciprsResponseStatus
, ciprsInstanceProfile
) 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 CreateInstanceProfile = CreateInstanceProfile'
{ _cipPath :: !(Maybe Text)
, _cipInstanceProfileName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createInstanceProfile
:: Text
-> CreateInstanceProfile
createInstanceProfile pInstanceProfileName_ =
CreateInstanceProfile'
{ _cipPath = Nothing
, _cipInstanceProfileName = pInstanceProfileName_
}
cipPath :: Lens' CreateInstanceProfile (Maybe Text)
cipPath = lens _cipPath (\ s a -> s{_cipPath = a});
cipInstanceProfileName :: Lens' CreateInstanceProfile Text
cipInstanceProfileName = lens _cipInstanceProfileName (\ s a -> s{_cipInstanceProfileName = a});
instance AWSRequest CreateInstanceProfile where
type Rs CreateInstanceProfile =
CreateInstanceProfileResponse
request = postQuery iam
response
= receiveXMLWrapper "CreateInstanceProfileResult"
(\ s h x ->
CreateInstanceProfileResponse' <$>
(pure (fromEnum s)) <*> (x .@ "InstanceProfile"))
instance Hashable CreateInstanceProfile
instance NFData CreateInstanceProfile
instance ToHeaders CreateInstanceProfile where
toHeaders = const mempty
instance ToPath CreateInstanceProfile where
toPath = const "/"
instance ToQuery CreateInstanceProfile where
toQuery CreateInstanceProfile'{..}
= mconcat
["Action" =: ("CreateInstanceProfile" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"Path" =: _cipPath,
"InstanceProfileName" =: _cipInstanceProfileName]
data CreateInstanceProfileResponse = CreateInstanceProfileResponse'
{ _ciprsResponseStatus :: !Int
, _ciprsInstanceProfile :: !InstanceProfile
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createInstanceProfileResponse
:: Int
-> InstanceProfile
-> CreateInstanceProfileResponse
createInstanceProfileResponse pResponseStatus_ pInstanceProfile_ =
CreateInstanceProfileResponse'
{ _ciprsResponseStatus = pResponseStatus_
, _ciprsInstanceProfile = pInstanceProfile_
}
ciprsResponseStatus :: Lens' CreateInstanceProfileResponse Int
ciprsResponseStatus = lens _ciprsResponseStatus (\ s a -> s{_ciprsResponseStatus = a});
ciprsInstanceProfile :: Lens' CreateInstanceProfileResponse InstanceProfile
ciprsInstanceProfile = lens _ciprsInstanceProfile (\ s a -> s{_ciprsInstanceProfile = a});
instance NFData CreateInstanceProfileResponse