module Network.AWS.CodeDeploy.ListOnPremisesInstances
(
listOnPremisesInstances
, ListOnPremisesInstances
, lopiTagFilters
, lopiNextToken
, lopiRegistrationStatus
, listOnPremisesInstancesResponse
, ListOnPremisesInstancesResponse
, lopirsNextToken
, lopirsInstanceNames
, lopirsResponseStatus
) 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 ListOnPremisesInstances = ListOnPremisesInstances'
{ _lopiTagFilters :: !(Maybe [TagFilter])
, _lopiNextToken :: !(Maybe Text)
, _lopiRegistrationStatus :: !(Maybe RegistrationStatus)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listOnPremisesInstances
:: ListOnPremisesInstances
listOnPremisesInstances =
ListOnPremisesInstances'
{ _lopiTagFilters = Nothing
, _lopiNextToken = Nothing
, _lopiRegistrationStatus = Nothing
}
lopiTagFilters :: Lens' ListOnPremisesInstances [TagFilter]
lopiTagFilters = lens _lopiTagFilters (\ s a -> s{_lopiTagFilters = a}) . _Default . _Coerce;
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});
instance AWSRequest ListOnPremisesInstances where
type Rs ListOnPremisesInstances =
ListOnPremisesInstancesResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
ListOnPremisesInstancesResponse' <$>
(x .?> "nextToken") <*>
(x .?> "instanceNames" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListOnPremisesInstances
instance NFData ListOnPremisesInstances
instance ToHeaders ListOnPremisesInstances where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.ListOnPremisesInstances" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListOnPremisesInstances where
toJSON ListOnPremisesInstances'{..}
= object
(catMaybes
[("tagFilters" .=) <$> _lopiTagFilters,
("nextToken" .=) <$> _lopiNextToken,
("registrationStatus" .=) <$>
_lopiRegistrationStatus])
instance ToPath ListOnPremisesInstances where
toPath = const "/"
instance ToQuery ListOnPremisesInstances where
toQuery = const mempty
data ListOnPremisesInstancesResponse = ListOnPremisesInstancesResponse'
{ _lopirsNextToken :: !(Maybe Text)
, _lopirsInstanceNames :: !(Maybe [Text])
, _lopirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listOnPremisesInstancesResponse
:: Int
-> ListOnPremisesInstancesResponse
listOnPremisesInstancesResponse pResponseStatus_ =
ListOnPremisesInstancesResponse'
{ _lopirsNextToken = Nothing
, _lopirsInstanceNames = Nothing
, _lopirsResponseStatus = pResponseStatus_
}
lopirsNextToken :: Lens' ListOnPremisesInstancesResponse (Maybe Text)
lopirsNextToken = lens _lopirsNextToken (\ s a -> s{_lopirsNextToken = a});
lopirsInstanceNames :: Lens' ListOnPremisesInstancesResponse [Text]
lopirsInstanceNames = lens _lopirsInstanceNames (\ s a -> s{_lopirsInstanceNames = a}) . _Default . _Coerce;
lopirsResponseStatus :: Lens' ListOnPremisesInstancesResponse Int
lopirsResponseStatus = lens _lopirsResponseStatus (\ s a -> s{_lopirsResponseStatus = a});
instance NFData ListOnPremisesInstancesResponse