module Network.AWS.CodeDeploy.GetDeploymentConfig
(
getDeploymentConfig
, GetDeploymentConfig
, gdcDeploymentConfigName
, getDeploymentConfigResponse
, GetDeploymentConfigResponse
, gdcrsDeploymentConfigInfo
, gdcrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetDeploymentConfig = GetDeploymentConfig'
{ _gdcDeploymentConfigName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDeploymentConfig
:: Text
-> GetDeploymentConfig
getDeploymentConfig pDeploymentConfigName_ =
GetDeploymentConfig'
{ _gdcDeploymentConfigName = pDeploymentConfigName_
}
gdcDeploymentConfigName :: Lens' GetDeploymentConfig Text
gdcDeploymentConfigName = lens _gdcDeploymentConfigName (\ s a -> s{_gdcDeploymentConfigName = a});
instance AWSRequest GetDeploymentConfig where
type Rs GetDeploymentConfig =
GetDeploymentConfigResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
GetDeploymentConfigResponse' <$>
(x .?> "deploymentConfigInfo") <*>
(pure (fromEnum s)))
instance ToHeaders GetDeploymentConfig where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.GetDeploymentConfig" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDeploymentConfig where
toJSON GetDeploymentConfig'{..}
= object
(catMaybes
[Just
("deploymentConfigName" .=
_gdcDeploymentConfigName)])
instance ToPath GetDeploymentConfig where
toPath = const "/"
instance ToQuery GetDeploymentConfig where
toQuery = const mempty
data GetDeploymentConfigResponse = GetDeploymentConfigResponse'
{ _gdcrsDeploymentConfigInfo :: !(Maybe DeploymentConfigInfo)
, _gdcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDeploymentConfigResponse
:: Int
-> GetDeploymentConfigResponse
getDeploymentConfigResponse pResponseStatus_ =
GetDeploymentConfigResponse'
{ _gdcrsDeploymentConfigInfo = Nothing
, _gdcrsResponseStatus = pResponseStatus_
}
gdcrsDeploymentConfigInfo :: Lens' GetDeploymentConfigResponse (Maybe DeploymentConfigInfo)
gdcrsDeploymentConfigInfo = lens _gdcrsDeploymentConfigInfo (\ s a -> s{_gdcrsDeploymentConfigInfo = a});
gdcrsResponseStatus :: Lens' GetDeploymentConfigResponse Int
gdcrsResponseStatus = lens _gdcrsResponseStatus (\ s a -> s{_gdcrsResponseStatus = a});