module Network.AWS.CodeDeploy.ListDeploymentInstances
(
ListDeploymentInstances
, listDeploymentInstances
, ldiDeploymentId
, ldiInstanceStatusFilter
, ldiNextToken
, ListDeploymentInstancesResponse
, listDeploymentInstancesResponse
, ldirInstancesList
, ldirNextToken
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
data ListDeploymentInstances = ListDeploymentInstances
{ _ldiDeploymentId :: Text
, _ldiInstanceStatusFilter :: List "instanceStatusFilter" InstanceStatus
, _ldiNextToken :: Maybe Text
} deriving (Eq, Show)
listDeploymentInstances :: Text
-> ListDeploymentInstances
listDeploymentInstances p1 = ListDeploymentInstances
{ _ldiDeploymentId = p1
, _ldiNextToken = Nothing
, _ldiInstanceStatusFilter = mempty
}
ldiDeploymentId :: Lens' ListDeploymentInstances Text
ldiDeploymentId = lens _ldiDeploymentId (\s a -> s { _ldiDeploymentId = a })
ldiInstanceStatusFilter :: Lens' ListDeploymentInstances [InstanceStatus]
ldiInstanceStatusFilter =
lens _ldiInstanceStatusFilter (\s a -> s { _ldiInstanceStatusFilter = a })
. _List
ldiNextToken :: Lens' ListDeploymentInstances (Maybe Text)
ldiNextToken = lens _ldiNextToken (\s a -> s { _ldiNextToken = a })
data ListDeploymentInstancesResponse = ListDeploymentInstancesResponse
{ _ldirInstancesList :: List "instancesList" Text
, _ldirNextToken :: Maybe Text
} deriving (Eq, Ord, Show)
listDeploymentInstancesResponse :: ListDeploymentInstancesResponse
listDeploymentInstancesResponse = ListDeploymentInstancesResponse
{ _ldirInstancesList = mempty
, _ldirNextToken = Nothing
}
ldirInstancesList :: Lens' ListDeploymentInstancesResponse [Text]
ldirInstancesList =
lens _ldirInstancesList (\s a -> s { _ldirInstancesList = a })
. _List
ldirNextToken :: Lens' ListDeploymentInstancesResponse (Maybe Text)
ldirNextToken = lens _ldirNextToken (\s a -> s { _ldirNextToken = a })
instance ToPath ListDeploymentInstances where
toPath = const "/"
instance ToQuery ListDeploymentInstances where
toQuery = const mempty
instance ToHeaders ListDeploymentInstances
instance ToJSON ListDeploymentInstances where
toJSON ListDeploymentInstances{..} = object
[ "deploymentId" .= _ldiDeploymentId
, "nextToken" .= _ldiNextToken
, "instanceStatusFilter" .= _ldiInstanceStatusFilter
]
instance AWSRequest ListDeploymentInstances where
type Sv ListDeploymentInstances = CodeDeploy
type Rs ListDeploymentInstances = ListDeploymentInstancesResponse
request = post "ListDeploymentInstances"
response = jsonResponse
instance FromJSON ListDeploymentInstancesResponse where
parseJSON = withObject "ListDeploymentInstancesResponse" $ \o -> ListDeploymentInstancesResponse
<$> o .: "instancesList"
<*> o .:? "nextToken"