module Network.AWS.EMR.ListBootstrapActions
(
ListBootstrapActions
, listBootstrapActions
, lbaClusterId
, lbaMarker
, ListBootstrapActionsResponse
, listBootstrapActionsResponse
, lbarBootstrapActions
, lbarMarker
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.EMR.Types
import qualified GHC.Exts
data ListBootstrapActions = ListBootstrapActions
{ _lbaClusterId :: Text
, _lbaMarker :: Maybe Text
} deriving (Eq, Ord, Show)
listBootstrapActions :: Text
-> ListBootstrapActions
listBootstrapActions p1 = ListBootstrapActions
{ _lbaClusterId = p1
, _lbaMarker = Nothing
}
lbaClusterId :: Lens' ListBootstrapActions Text
lbaClusterId = lens _lbaClusterId (\s a -> s { _lbaClusterId = a })
lbaMarker :: Lens' ListBootstrapActions (Maybe Text)
lbaMarker = lens _lbaMarker (\s a -> s { _lbaMarker = a })
data ListBootstrapActionsResponse = ListBootstrapActionsResponse
{ _lbarBootstrapActions :: List "BootstrapActions" Command
, _lbarMarker :: Maybe Text
} deriving (Eq, Show)
listBootstrapActionsResponse :: ListBootstrapActionsResponse
listBootstrapActionsResponse = ListBootstrapActionsResponse
{ _lbarBootstrapActions = mempty
, _lbarMarker = Nothing
}
lbarBootstrapActions :: Lens' ListBootstrapActionsResponse [Command]
lbarBootstrapActions =
lens _lbarBootstrapActions (\s a -> s { _lbarBootstrapActions = a })
. _List
lbarMarker :: Lens' ListBootstrapActionsResponse (Maybe Text)
lbarMarker = lens _lbarMarker (\s a -> s { _lbarMarker = a })
instance ToPath ListBootstrapActions where
toPath = const "/"
instance ToQuery ListBootstrapActions where
toQuery = const mempty
instance ToHeaders ListBootstrapActions
instance ToJSON ListBootstrapActions where
toJSON ListBootstrapActions{..} = object
[ "ClusterId" .= _lbaClusterId
, "Marker" .= _lbaMarker
]
instance AWSRequest ListBootstrapActions where
type Sv ListBootstrapActions = EMR
type Rs ListBootstrapActions = ListBootstrapActionsResponse
request = post "ListBootstrapActions"
response = jsonResponse
instance FromJSON ListBootstrapActionsResponse where
parseJSON = withObject "ListBootstrapActionsResponse" $ \o -> ListBootstrapActionsResponse
<$> o .:? "BootstrapActions" .!= mempty
<*> o .:? "Marker"
instance AWSPager ListBootstrapActions where
page rq rs
| stop (rq ^. lbaMarker) = Nothing
| otherwise = (\x -> rq & lbaMarker ?~ x)
<$> (rs ^. lbarMarker)