module Network.AWS.CodeDeploy.GetDeploymentInstance
(
getDeploymentInstance
, GetDeploymentInstance
, gdiDeploymentId
, gdiInstanceId
, getDeploymentInstanceResponse
, GetDeploymentInstanceResponse
, gdirsInstanceSummary
, gdirsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetDeploymentInstance = GetDeploymentInstance'
{ _gdiDeploymentId :: !Text
, _gdiInstanceId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDeploymentInstance
:: Text
-> Text
-> GetDeploymentInstance
getDeploymentInstance pDeploymentId_ pInstanceId_ =
GetDeploymentInstance'
{ _gdiDeploymentId = pDeploymentId_
, _gdiInstanceId = pInstanceId_
}
gdiDeploymentId :: Lens' GetDeploymentInstance Text
gdiDeploymentId = lens _gdiDeploymentId (\ s a -> s{_gdiDeploymentId = a});
gdiInstanceId :: Lens' GetDeploymentInstance Text
gdiInstanceId = lens _gdiInstanceId (\ s a -> s{_gdiInstanceId = a});
instance AWSRequest GetDeploymentInstance where
type Rs GetDeploymentInstance =
GetDeploymentInstanceResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
GetDeploymentInstanceResponse' <$>
(x .?> "instanceSummary") <*> (pure (fromEnum s)))
instance ToHeaders GetDeploymentInstance where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.GetDeploymentInstance" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDeploymentInstance where
toJSON GetDeploymentInstance'{..}
= object
(catMaybes
[Just ("deploymentId" .= _gdiDeploymentId),
Just ("instanceId" .= _gdiInstanceId)])
instance ToPath GetDeploymentInstance where
toPath = const "/"
instance ToQuery GetDeploymentInstance where
toQuery = const mempty
data GetDeploymentInstanceResponse = GetDeploymentInstanceResponse'
{ _gdirsInstanceSummary :: !(Maybe InstanceSummary)
, _gdirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDeploymentInstanceResponse
:: Int
-> GetDeploymentInstanceResponse
getDeploymentInstanceResponse pResponseStatus_ =
GetDeploymentInstanceResponse'
{ _gdirsInstanceSummary = Nothing
, _gdirsResponseStatus = pResponseStatus_
}
gdirsInstanceSummary :: Lens' GetDeploymentInstanceResponse (Maybe InstanceSummary)
gdirsInstanceSummary = lens _gdirsInstanceSummary (\ s a -> s{_gdirsInstanceSummary = a});
gdirsResponseStatus :: Lens' GetDeploymentInstanceResponse Int
gdirsResponseStatus = lens _gdirsResponseStatus (\ s a -> s{_gdirsResponseStatus = a});