module Network.AWS.EMR.ListBootstrapActions
(
listBootstrapActions
, ListBootstrapActions
, lbaMarker
, lbaClusterId
, listBootstrapActionsResponse
, ListBootstrapActionsResponse
, lbarsBootstrapActions
, lbarsMarker
, lbarsResponseStatus
) where
import Network.AWS.EMR.Types
import Network.AWS.EMR.Types.Product
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListBootstrapActions = ListBootstrapActions'
{ _lbaMarker :: !(Maybe Text)
, _lbaClusterId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listBootstrapActions
:: Text
-> ListBootstrapActions
listBootstrapActions pClusterId_ =
ListBootstrapActions'
{ _lbaMarker = Nothing
, _lbaClusterId = pClusterId_
}
lbaMarker :: Lens' ListBootstrapActions (Maybe Text)
lbaMarker = lens _lbaMarker (\ s a -> s{_lbaMarker = a});
lbaClusterId :: Lens' ListBootstrapActions Text
lbaClusterId = lens _lbaClusterId (\ s a -> s{_lbaClusterId = a});
instance AWSPager ListBootstrapActions where
page rq rs
| stop (rs ^. lbarsMarker) = Nothing
| stop (rs ^. lbarsBootstrapActions) = Nothing
| otherwise =
Just $ rq & lbaMarker .~ rs ^. lbarsMarker
instance AWSRequest ListBootstrapActions where
type Rs ListBootstrapActions =
ListBootstrapActionsResponse
request = postJSON emr
response
= receiveJSON
(\ s h x ->
ListBootstrapActionsResponse' <$>
(x .?> "BootstrapActions" .!@ mempty) <*>
(x .?> "Marker")
<*> (pure (fromEnum s)))
instance Hashable ListBootstrapActions
instance NFData ListBootstrapActions
instance ToHeaders ListBootstrapActions where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("ElasticMapReduce.ListBootstrapActions" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListBootstrapActions where
toJSON ListBootstrapActions'{..}
= object
(catMaybes
[("Marker" .=) <$> _lbaMarker,
Just ("ClusterId" .= _lbaClusterId)])
instance ToPath ListBootstrapActions where
toPath = const "/"
instance ToQuery ListBootstrapActions where
toQuery = const mempty
data ListBootstrapActionsResponse = ListBootstrapActionsResponse'
{ _lbarsBootstrapActions :: !(Maybe [Command])
, _lbarsMarker :: !(Maybe Text)
, _lbarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listBootstrapActionsResponse
:: Int
-> ListBootstrapActionsResponse
listBootstrapActionsResponse pResponseStatus_ =
ListBootstrapActionsResponse'
{ _lbarsBootstrapActions = Nothing
, _lbarsMarker = Nothing
, _lbarsResponseStatus = pResponseStatus_
}
lbarsBootstrapActions :: Lens' ListBootstrapActionsResponse [Command]
lbarsBootstrapActions = lens _lbarsBootstrapActions (\ s a -> s{_lbarsBootstrapActions = a}) . _Default . _Coerce;
lbarsMarker :: Lens' ListBootstrapActionsResponse (Maybe Text)
lbarsMarker = lens _lbarsMarker (\ s a -> s{_lbarsMarker = a});
lbarsResponseStatus :: Lens' ListBootstrapActionsResponse Int
lbarsResponseStatus = lens _lbarsResponseStatus (\ s a -> s{_lbarsResponseStatus = a});
instance NFData ListBootstrapActionsResponse