module Network.AWS.CodeDeploy.ListOnPremisesInstances
(
ListOnPremisesInstances
, listOnPremisesInstances
, lopiNextToken
, lopiRegistrationStatus
, lopiTagFilters
, ListOnPremisesInstancesResponse
, listOnPremisesInstancesResponse
, lopirInstanceNames
, lopirNextToken
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
data ListOnPremisesInstances = ListOnPremisesInstances
{ _lopiNextToken :: Maybe Text
, _lopiRegistrationStatus :: Maybe RegistrationStatus
, _lopiTagFilters :: List "tagFilters" TagFilter
} deriving (Eq, Read, Show)
listOnPremisesInstances :: ListOnPremisesInstances
listOnPremisesInstances = ListOnPremisesInstances
{ _lopiRegistrationStatus = Nothing
, _lopiTagFilters = mempty
, _lopiNextToken = Nothing
}
lopiNextToken :: Lens' ListOnPremisesInstances (Maybe Text)
lopiNextToken = lens _lopiNextToken (\s a -> s { _lopiNextToken = a })
lopiRegistrationStatus :: Lens' ListOnPremisesInstances (Maybe RegistrationStatus)
lopiRegistrationStatus =
lens _lopiRegistrationStatus (\s a -> s { _lopiRegistrationStatus = a })
lopiTagFilters :: Lens' ListOnPremisesInstances [TagFilter]
lopiTagFilters = lens _lopiTagFilters (\s a -> s { _lopiTagFilters = a }) . _List
data ListOnPremisesInstancesResponse = ListOnPremisesInstancesResponse
{ _lopirInstanceNames :: List "instanceNames" Text
, _lopirNextToken :: Maybe Text
} deriving (Eq, Ord, Read, Show)
listOnPremisesInstancesResponse :: ListOnPremisesInstancesResponse
listOnPremisesInstancesResponse = ListOnPremisesInstancesResponse
{ _lopirInstanceNames = mempty
, _lopirNextToken = Nothing
}
lopirInstanceNames :: Lens' ListOnPremisesInstancesResponse [Text]
lopirInstanceNames =
lens _lopirInstanceNames (\s a -> s { _lopirInstanceNames = a })
. _List
lopirNextToken :: Lens' ListOnPremisesInstancesResponse (Maybe Text)
lopirNextToken = lens _lopirNextToken (\s a -> s { _lopirNextToken = a })
instance ToPath ListOnPremisesInstances where
toPath = const "/"
instance ToQuery ListOnPremisesInstances where
toQuery = const mempty
instance ToHeaders ListOnPremisesInstances
instance ToJSON ListOnPremisesInstances where
toJSON ListOnPremisesInstances{..} = object
[ "registrationStatus" .= _lopiRegistrationStatus
, "tagFilters" .= _lopiTagFilters
, "nextToken" .= _lopiNextToken
]
instance AWSRequest ListOnPremisesInstances where
type Sv ListOnPremisesInstances = CodeDeploy
type Rs ListOnPremisesInstances = ListOnPremisesInstancesResponse
request = post "ListOnPremisesInstances"
response = jsonResponse
instance FromJSON ListOnPremisesInstancesResponse where
parseJSON = withObject "ListOnPremisesInstancesResponse" $ \o -> ListOnPremisesInstancesResponse
<$> o .:? "instanceNames" .!= mempty
<*> o .:? "nextToken"