module Network.AWS.CodeDeploy.GetDeploymentConfig
(
getDeploymentConfig
, GetDeploymentConfig
, gdcDeploymentConfigName
, getDeploymentConfigResponse
, GetDeploymentConfigResponse
, gdcrsDeploymentConfigInfo
, gdcrsStatus
) 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 Sv GetDeploymentConfig = CodeDeploy
type Rs GetDeploymentConfig =
GetDeploymentConfigResponse
request = postJSON
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
["deploymentConfigName" .= _gdcDeploymentConfigName]
instance ToPath GetDeploymentConfig where
toPath = const "/"
instance ToQuery GetDeploymentConfig where
toQuery = const mempty
data GetDeploymentConfigResponse = GetDeploymentConfigResponse'
{ _gdcrsDeploymentConfigInfo :: !(Maybe DeploymentConfigInfo)
, _gdcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDeploymentConfigResponse
:: Int
-> GetDeploymentConfigResponse
getDeploymentConfigResponse pStatus_ =
GetDeploymentConfigResponse'
{ _gdcrsDeploymentConfigInfo = Nothing
, _gdcrsStatus = pStatus_
}
gdcrsDeploymentConfigInfo :: Lens' GetDeploymentConfigResponse (Maybe DeploymentConfigInfo)
gdcrsDeploymentConfigInfo = lens _gdcrsDeploymentConfigInfo (\ s a -> s{_gdcrsDeploymentConfigInfo = a});
gdcrsStatus :: Lens' GetDeploymentConfigResponse Int
gdcrsStatus = lens _gdcrsStatus (\ s a -> s{_gdcrsStatus = a});