module Network.AWS.CodeDeploy.GetDeploymentGroup
(
getDeploymentGroup
, GetDeploymentGroup
, gdgApplicationName
, gdgDeploymentGroupName
, getDeploymentGroupResponse
, GetDeploymentGroupResponse
, gdgrsDeploymentGroupInfo
, gdgrsResponseStatus
) 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 GetDeploymentGroup = GetDeploymentGroup'
{ _gdgApplicationName :: !Text
, _gdgDeploymentGroupName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeploymentGroup
:: Text
-> Text
-> GetDeploymentGroup
getDeploymentGroup pApplicationName_ pDeploymentGroupName_ =
GetDeploymentGroup'
{ _gdgApplicationName = pApplicationName_
, _gdgDeploymentGroupName = pDeploymentGroupName_
}
gdgApplicationName :: Lens' GetDeploymentGroup Text
gdgApplicationName = lens _gdgApplicationName (\ s a -> s{_gdgApplicationName = a});
gdgDeploymentGroupName :: Lens' GetDeploymentGroup Text
gdgDeploymentGroupName = lens _gdgDeploymentGroupName (\ s a -> s{_gdgDeploymentGroupName = a});
instance AWSRequest GetDeploymentGroup where
type Rs GetDeploymentGroup =
GetDeploymentGroupResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
GetDeploymentGroupResponse' <$>
(x .?> "deploymentGroupInfo") <*>
(pure (fromEnum s)))
instance Hashable GetDeploymentGroup where
instance NFData GetDeploymentGroup where
instance ToHeaders GetDeploymentGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.GetDeploymentGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDeploymentGroup where
toJSON GetDeploymentGroup'{..}
= object
(catMaybes
[Just ("applicationName" .= _gdgApplicationName),
Just
("deploymentGroupName" .= _gdgDeploymentGroupName)])
instance ToPath GetDeploymentGroup where
toPath = const "/"
instance ToQuery GetDeploymentGroup where
toQuery = const mempty
data GetDeploymentGroupResponse = GetDeploymentGroupResponse'
{ _gdgrsDeploymentGroupInfo :: !(Maybe DeploymentGroupInfo)
, _gdgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeploymentGroupResponse
:: Int
-> GetDeploymentGroupResponse
getDeploymentGroupResponse pResponseStatus_ =
GetDeploymentGroupResponse'
{_gdgrsDeploymentGroupInfo = Nothing, _gdgrsResponseStatus = pResponseStatus_}
gdgrsDeploymentGroupInfo :: Lens' GetDeploymentGroupResponse (Maybe DeploymentGroupInfo)
gdgrsDeploymentGroupInfo = lens _gdgrsDeploymentGroupInfo (\ s a -> s{_gdgrsDeploymentGroupInfo = a});
gdgrsResponseStatus :: Lens' GetDeploymentGroupResponse Int
gdgrsResponseStatus = lens _gdgrsResponseStatus (\ s a -> s{_gdgrsResponseStatus = a});
instance NFData GetDeploymentGroupResponse where