module MediaWiki.API.Query.Random where
import MediaWiki.API.Types
import MediaWiki.API.Utils
data RandomPagesRequest
= RandomPagesRequest
{ rnNamespaces :: [NamespaceID]
, rnLimit :: Maybe Int
}
instance APIRequest RandomPagesRequest where
queryKind _ = QList "random"
showReq r = [ opt1 "rnnamespace" (rnNamespaces r)
, mbOpt "rnlimit" show (rnLimit r)
]
emptyRandomPagesRequest :: RandomPagesRequest
emptyRandomPagesRequest = RandomPagesRequest
{ rnNamespaces = []
, rnLimit = Nothing
}
data RandomPagesResponse
= RandomPagesResponse
{ rnPages :: [PageTitle]
}
emptyRandomPagesResponse :: RandomPagesResponse
emptyRandomPagesResponse
= RandomPagesResponse
{ rnPages = []
}