module Network.AWS.CodeDeploy.ListDeploymentGroups
(
listDeploymentGroups
, ListDeploymentGroups
, ldgNextToken
, ldgApplicationName
, listDeploymentGroupsResponse
, ListDeploymentGroupsResponse
, ldgrsNextToken
, ldgrsApplicationName
, ldgrsDeploymentGroups
, ldgrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListDeploymentGroups = ListDeploymentGroups'
{ _ldgNextToken :: !(Maybe Text)
, _ldgApplicationName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listDeploymentGroups
:: Text
-> ListDeploymentGroups
listDeploymentGroups pApplicationName_ =
ListDeploymentGroups'
{ _ldgNextToken = Nothing
, _ldgApplicationName = pApplicationName_
}
ldgNextToken :: Lens' ListDeploymentGroups (Maybe Text)
ldgNextToken = lens _ldgNextToken (\ s a -> s{_ldgNextToken = a});
ldgApplicationName :: Lens' ListDeploymentGroups Text
ldgApplicationName = lens _ldgApplicationName (\ s a -> s{_ldgApplicationName = a});
instance AWSRequest ListDeploymentGroups where
type Rs ListDeploymentGroups =
ListDeploymentGroupsResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
ListDeploymentGroupsResponse' <$>
(x .?> "nextToken") <*> (x .?> "applicationName") <*>
(x .?> "deploymentGroups" .!@ mempty)
<*> (pure (fromEnum s)))
instance ToHeaders ListDeploymentGroups where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.ListDeploymentGroups" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListDeploymentGroups where
toJSON ListDeploymentGroups'{..}
= object
(catMaybes
[("nextToken" .=) <$> _ldgNextToken,
Just ("applicationName" .= _ldgApplicationName)])
instance ToPath ListDeploymentGroups where
toPath = const "/"
instance ToQuery ListDeploymentGroups where
toQuery = const mempty
data ListDeploymentGroupsResponse = ListDeploymentGroupsResponse'
{ _ldgrsNextToken :: !(Maybe Text)
, _ldgrsApplicationName :: !(Maybe Text)
, _ldgrsDeploymentGroups :: !(Maybe [Text])
, _ldgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listDeploymentGroupsResponse
:: Int
-> ListDeploymentGroupsResponse
listDeploymentGroupsResponse pResponseStatus_ =
ListDeploymentGroupsResponse'
{ _ldgrsNextToken = Nothing
, _ldgrsApplicationName = Nothing
, _ldgrsDeploymentGroups = Nothing
, _ldgrsResponseStatus = pResponseStatus_
}
ldgrsNextToken :: Lens' ListDeploymentGroupsResponse (Maybe Text)
ldgrsNextToken = lens _ldgrsNextToken (\ s a -> s{_ldgrsNextToken = a});
ldgrsApplicationName :: Lens' ListDeploymentGroupsResponse (Maybe Text)
ldgrsApplicationName = lens _ldgrsApplicationName (\ s a -> s{_ldgrsApplicationName = a});
ldgrsDeploymentGroups :: Lens' ListDeploymentGroupsResponse [Text]
ldgrsDeploymentGroups = lens _ldgrsDeploymentGroups (\ s a -> s{_ldgrsDeploymentGroups = a}) . _Default . _Coerce;
ldgrsResponseStatus :: Lens' ListDeploymentGroupsResponse Int
ldgrsResponseStatus = lens _ldgrsResponseStatus (\ s a -> s{_ldgrsResponseStatus = a});