module Network.AWS.CodeDeploy.ListDeploymentConfigs
(
ListDeploymentConfigs
, listDeploymentConfigs
, ldcNextToken
, ListDeploymentConfigsResponse
, listDeploymentConfigsResponse
, ldcrDeploymentConfigsList
, ldcrNextToken
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype ListDeploymentConfigs = ListDeploymentConfigs
{ _ldcNextToken :: Maybe Text
} deriving (Eq, Ord, Read, Show, Monoid)
listDeploymentConfigs :: ListDeploymentConfigs
listDeploymentConfigs = ListDeploymentConfigs
{ _ldcNextToken = Nothing
}
ldcNextToken :: Lens' ListDeploymentConfigs (Maybe Text)
ldcNextToken = lens _ldcNextToken (\s a -> s { _ldcNextToken = a })
data ListDeploymentConfigsResponse = ListDeploymentConfigsResponse
{ _ldcrDeploymentConfigsList :: List "deploymentConfigsList" Text
, _ldcrNextToken :: Maybe Text
} deriving (Eq, Ord, Read, Show)
listDeploymentConfigsResponse :: ListDeploymentConfigsResponse
listDeploymentConfigsResponse = ListDeploymentConfigsResponse
{ _ldcrDeploymentConfigsList = mempty
, _ldcrNextToken = Nothing
}
ldcrDeploymentConfigsList :: Lens' ListDeploymentConfigsResponse [Text]
ldcrDeploymentConfigsList =
lens _ldcrDeploymentConfigsList
(\s a -> s { _ldcrDeploymentConfigsList = a })
. _List
ldcrNextToken :: Lens' ListDeploymentConfigsResponse (Maybe Text)
ldcrNextToken = lens _ldcrNextToken (\s a -> s { _ldcrNextToken = a })
instance ToPath ListDeploymentConfigs where
toPath = const "/"
instance ToQuery ListDeploymentConfigs where
toQuery = const mempty
instance ToHeaders ListDeploymentConfigs
instance ToJSON ListDeploymentConfigs where
toJSON ListDeploymentConfigs{..} = object
[ "nextToken" .= _ldcNextToken
]
instance AWSRequest ListDeploymentConfigs where
type Sv ListDeploymentConfigs = CodeDeploy
type Rs ListDeploymentConfigs = ListDeploymentConfigsResponse
request = post "ListDeploymentConfigs"
response = jsonResponse
instance FromJSON ListDeploymentConfigsResponse where
parseJSON = withObject "ListDeploymentConfigsResponse" $ \o -> ListDeploymentConfigsResponse
<$> o .:? "deploymentConfigsList" .!= mempty
<*> o .:? "nextToken"