import { GetWikiPageResponse, GetWikiPagesResponse, HideWikiPageRevisionResponse, WikiPageRevisionListing, WikiPageSettings, } from '@devvit/protos/types/devvit/plugin/redditapi/wiki/wiki_msg.js';
import { Empty } from '@devvit/protos/types/google/protobuf/empty.js';
import { RedditAPI } from './RedditAPI.js';
export class Wiki extends RedditAPI {
    async GetWikiPages(request, metadata) {
        const response = await this._fetch('GetWikiPages', request, metadata);
        return GetWikiPagesResponse.fromJSON(this._decodeAndValidateResponseJSON(response));
    }
    async GetWikiPage(request, metadata) {
        const response = await this._fetch('GetWikiPage', request, metadata);
        return GetWikiPageResponse.fromJSON(this._decodeAndValidateResponseJSON(response));
    }
    async EditWikiPage(request, metadata) {
        await this._fetch('EditWikiPage', request, metadata);
        return Empty.fromPartial({});
    }
    async HideWikiPageRevision(request, metadata) {
        const response = await this._fetch('HideWikiPage', request, metadata);
        return HideWikiPageRevisionResponse.fromJSON(this._decodeAndValidateResponseJSON(response));
    }
    async GetWikiPageRevisions(request, metadata) {
        const repsonse = await this._fetch('GetWikiPageRevisions', request, metadata);
        return WikiPageRevisionListing.fromJSON(this._decodeAndValidateResponseJSON(repsonse));
    }
    async GetWikiRevisions(request, metadata) {
        const response = await this._fetch('GetWikiRevisions', request, metadata);
        return WikiPageRevisionListing.fromJSON(this._decodeAndValidateResponseJSON(response));
    }
    async RevertWikiPage(request, metadata) {
        await this._fetch('RevertWikiPage', request, metadata);
        return Empty.fromPartial({});
    }
    async GetWikiPageSettings(request, metadata) {
        const response = await this._fetch('GetWikiPageSettings', request, metadata);
        return WikiPageSettings.fromJSON(this._decodeAndValidateResponseJSON(response));
    }
    async UpdateWikiPageSettings(request, metadata) {
        const response = await this._fetch('UpdateWikiPageSettings', request, metadata);
        return WikiPageSettings.fromJSON(this._decodeAndValidateResponseJSON(response));
    }
    async AllowEditor(request, metadata) {
        await this._fetch('AllowEditor', request, metadata);
        return Empty.fromPartial({});
    }
}
