Protect Page?
Wanting to know if this library has support for protecting a page for editing, because I can't find that information anywhere in the documentation.
While you can use WikiPage.Protections and WikiPage.RestrictionTypes to retrieve the current protection status of a page, WCL currently does not provide methods for changing protection status.
That being said, you can leverage WikiSite.InvokeMediaWikiApiAsync to send a MediaWiki API request with action=protect by yourself, similar to the existing code in WCL codebase.
For its usage, while I'd suggest you look for existing references to this method in the codebase, you can also refer to the "Remarks" section of MediaWikiFormRequestMessage for some hints on how the values in your anonymous objects are converted into application/x-www-form-urlencoded payloads.
Hey, thanks! That's exactly what I ended up doing. Worked great, for the most part. However, I did run into an exception every now and then. I ended up catching and disposing of the exception as it occurred because it didn't seem to actually prevent the call to protect the page. I kind of assumed it was some kind of library-side overflow or rate-limit, because my account on the wiki that I'm working with is not rate-limited for API calls. This is the exception that it threw.
mediawiki internal_api_error_DBQueryError: [ec3e27e09a14e5500cb1bb37] Exception caught: A database query error has occurred. This may indicate a bug in the software.
internal_api_error_DBQueryError
Actually this is sever-side error. You can look for similar errors on Phabricator: https://phabricator.wikimedia.org/search/query/V_mHQ3iNCA9X/
I'll leave this issue opened until I get the page protection API exposed from the library.
Oh, perfect! Thanks. I'll look into that.