module Network.AWS.EC2.DisassociateIAMInstanceProfile
(
disassociateIAMInstanceProfile
, DisassociateIAMInstanceProfile
, diapAssociationId
, disassociateIAMInstanceProfileResponse
, DisassociateIAMInstanceProfileResponse
, diaprsIAMInstanceProfileAssociation
, diaprsResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DisassociateIAMInstanceProfile = DisassociateIAMInstanceProfile'
{ _diapAssociationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateIAMInstanceProfile
:: Text
-> DisassociateIAMInstanceProfile
disassociateIAMInstanceProfile pAssociationId_ =
DisassociateIAMInstanceProfile' {_diapAssociationId = pAssociationId_}
diapAssociationId :: Lens' DisassociateIAMInstanceProfile Text
diapAssociationId = lens _diapAssociationId (\ s a -> s{_diapAssociationId = a});
instance AWSRequest DisassociateIAMInstanceProfile
where
type Rs DisassociateIAMInstanceProfile =
DisassociateIAMInstanceProfileResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
DisassociateIAMInstanceProfileResponse' <$>
(x .@? "iamInstanceProfileAssociation") <*>
(pure (fromEnum s)))
instance Hashable DisassociateIAMInstanceProfile
where
instance NFData DisassociateIAMInstanceProfile where
instance ToHeaders DisassociateIAMInstanceProfile
where
toHeaders = const mempty
instance ToPath DisassociateIAMInstanceProfile where
toPath = const "/"
instance ToQuery DisassociateIAMInstanceProfile where
toQuery DisassociateIAMInstanceProfile'{..}
= mconcat
["Action" =:
("DisassociateIamInstanceProfile" :: ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"AssociationId" =: _diapAssociationId]
data DisassociateIAMInstanceProfileResponse = DisassociateIAMInstanceProfileResponse'
{ _diaprsIAMInstanceProfileAssociation :: !(Maybe IAMInstanceProfileAssociation)
, _diaprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
disassociateIAMInstanceProfileResponse
:: Int
-> DisassociateIAMInstanceProfileResponse
disassociateIAMInstanceProfileResponse pResponseStatus_ =
DisassociateIAMInstanceProfileResponse'
{ _diaprsIAMInstanceProfileAssociation = Nothing
, _diaprsResponseStatus = pResponseStatus_
}
diaprsIAMInstanceProfileAssociation :: Lens' DisassociateIAMInstanceProfileResponse (Maybe IAMInstanceProfileAssociation)
diaprsIAMInstanceProfileAssociation = lens _diaprsIAMInstanceProfileAssociation (\ s a -> s{_diaprsIAMInstanceProfileAssociation = a});
diaprsResponseStatus :: Lens' DisassociateIAMInstanceProfileResponse Int
diaprsResponseStatus = lens _diaprsResponseStatus (\ s a -> s{_diaprsResponseStatus = a});
instance NFData
DisassociateIAMInstanceProfileResponse
where