{-# 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.EC2.ReplaceIAMInstanceProfileAssociation
(
replaceIAMInstanceProfileAssociation
, ReplaceIAMInstanceProfileAssociation
, riapaIAMInstanceProfile
, riapaAssociationId
, replaceIAMInstanceProfileAssociationResponse
, ReplaceIAMInstanceProfileAssociationResponse
, riaparsIAMInstanceProfileAssociation
, riaparsResponseStatus
) 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
data ReplaceIAMInstanceProfileAssociation = ReplaceIAMInstanceProfileAssociation'
{ _riapaIAMInstanceProfile :: !IAMInstanceProfileSpecification
, _riapaAssociationId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
replaceIAMInstanceProfileAssociation
:: IAMInstanceProfileSpecification
-> Text
-> ReplaceIAMInstanceProfileAssociation
replaceIAMInstanceProfileAssociation pIAMInstanceProfile_ pAssociationId_ =
ReplaceIAMInstanceProfileAssociation'
{ _riapaIAMInstanceProfile = pIAMInstanceProfile_
, _riapaAssociationId = pAssociationId_
}
riapaIAMInstanceProfile :: Lens' ReplaceIAMInstanceProfileAssociation IAMInstanceProfileSpecification
riapaIAMInstanceProfile = lens _riapaIAMInstanceProfile (\ s a -> s{_riapaIAMInstanceProfile = a})
riapaAssociationId :: Lens' ReplaceIAMInstanceProfileAssociation Text
riapaAssociationId = lens _riapaAssociationId (\ s a -> s{_riapaAssociationId = a})
instance AWSRequest
ReplaceIAMInstanceProfileAssociation
where
type Rs ReplaceIAMInstanceProfileAssociation =
ReplaceIAMInstanceProfileAssociationResponse
request = postQuery ec2
response
= receiveXML
(\ s h x ->
ReplaceIAMInstanceProfileAssociationResponse' <$>
(x .@? "iamInstanceProfileAssociation") <*>
(pure (fromEnum s)))
instance Hashable
ReplaceIAMInstanceProfileAssociation
where
instance NFData ReplaceIAMInstanceProfileAssociation
where
instance ToHeaders
ReplaceIAMInstanceProfileAssociation
where
toHeaders = const mempty
instance ToPath ReplaceIAMInstanceProfileAssociation
where
toPath = const "/"
instance ToQuery ReplaceIAMInstanceProfileAssociation
where
toQuery ReplaceIAMInstanceProfileAssociation'{..}
= mconcat
["Action" =:
("ReplaceIamInstanceProfileAssociation" ::
ByteString),
"Version" =: ("2016-11-15" :: ByteString),
"IamInstanceProfile" =: _riapaIAMInstanceProfile,
"AssociationId" =: _riapaAssociationId]
data ReplaceIAMInstanceProfileAssociationResponse = ReplaceIAMInstanceProfileAssociationResponse'
{ _riaparsIAMInstanceProfileAssociation :: !(Maybe IAMInstanceProfileAssociation)
, _riaparsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
replaceIAMInstanceProfileAssociationResponse
:: Int
-> ReplaceIAMInstanceProfileAssociationResponse
replaceIAMInstanceProfileAssociationResponse pResponseStatus_ =
ReplaceIAMInstanceProfileAssociationResponse'
{ _riaparsIAMInstanceProfileAssociation = Nothing
, _riaparsResponseStatus = pResponseStatus_
}
riaparsIAMInstanceProfileAssociation :: Lens' ReplaceIAMInstanceProfileAssociationResponse (Maybe IAMInstanceProfileAssociation)
riaparsIAMInstanceProfileAssociation = lens _riaparsIAMInstanceProfileAssociation (\ s a -> s{_riaparsIAMInstanceProfileAssociation = a})
riaparsResponseStatus :: Lens' ReplaceIAMInstanceProfileAssociationResponse Int
riaparsResponseStatus = lens _riaparsResponseStatus (\ s a -> s{_riaparsResponseStatus = a})
instance NFData
ReplaceIAMInstanceProfileAssociationResponse
where