syntax = "proto3"; package devvit.plugin.redditapi.wiki; import "devvit/plugin/redditapi/common/common_msg.proto"; import "google/protobuf/wrappers.proto"; option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/plugin/redditapi"; option java_package = "com.reddit.devvit.plugin.redditapi.wiki"; // WikiVersion identifies a wiki implementation. enum WikiVersion { // No wiki version specified. WIKI_VERSION_UNSPECIFIED = 0; // Old Reddit wiki. These are found in old.reddit.com WIKI_VERSION_V1 = 1; // Wikis service. These are found in reddit.com as well as the mobile apps WIKI_VERSION_V2 = 2; } message IsWikiVersionEnabledInSubredditRequest { // The subreddit name, with an optional r/ prefix. string subreddit = 1; // The wiki version to check. Must not be WIKI_VERSION_UNSPECIFIED. WikiVersion wiki_version = 2; } message IsWikiVersionEnabledInSubredditResponse { // Whether the requested wiki version is enabled for the subreddit. bool enabled = 1; } message GetWikiPagesRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 2; } message GetWikiPagesResponse { // String value: "wikipagelisting" string kind = 1; // A list of wiki page names. repeated string data = 2; } message GetWikiPageRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // The revision ID (UUID) of the wiki page to retrieve. Setting this value will return the wiki page // version at that revision, and leaving it empty will return the latest version. google.protobuf.StringValue revision_id = 3; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 4; } message WikiPage { // The markdown content of the wiki page. string content_md = 1; // The HTML content of the wiki page. string content_html = 2; // The revision ID of the wiki page. string revision_id = 3; // The date of the wiki page's last revision. int64 revision_date = 4; // Whether the wiki page can be revised. bool may_revise = 5; // The reason for the wiki page's last revision. google.protobuf.StringValue reason = 6; // The user who last edited the wiki page. devvit.plugin.redditapi.common.WrappedUserObject revision_by = 7; } message GetWikiPageResponse { // String value: "wikipage" string kind = 1; // The data of the wiki page. WikiPage data = 2; } message EditWikiPageRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // The new content of the wiki page. string content = 3; // The reason for the edit. string reason = 4; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 5; } message HideWikiPageRevisionRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // The revision ID to hide. string revision = 3; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 4; } message HideWikiPageRevisionResponse { // Whether the revision was hidden. bool status = 1; } message GetWikiPageRevisionsRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // Revision ID // Return Revisions in the listing up to this Revision (non-inclusive) // Note: Do not use `before` and `after` in the same request google.protobuf.StringValue after = 3; // Revision ID // Return Revisions in the listing starting after this Revision (non-inclusive) // Note: Do not use `before` and `after` in the same request google.protobuf.StringValue before = 4; // The maximum number of revisions to return. google.protobuf.Int64Value limit = 5; // The number of items seen so far. // Use when fetching subsequent pages with `before` or `after`. google.protobuf.Int64Value count = 6; // (optional) Show all results regardless of user preferences google.protobuf.BoolValue show = 7; // (optional) expand subreddits google.protobuf.BoolValue sr_detail = 8; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 9; } message WikiPageRevision { // ID of the revision. string id = 1; // The name of the wiki page. string page = 2; // The date of the revision. int64 timestamp = 3; // The reason for the revision. string reason = 4; // Whether the revision is hidden. bool revision_hidden = 5; // The user who made the revision. devvit.plugin.redditapi.common.WrappedUserObject author = 6; } message WikiPageRevisionListing { message Data { // If present, use this as the `after` parameter when calling the same // API again to fetch the next page google.protobuf.StringValue after = 1; // If present, use this as the `before` parameter when calling the same // API again to fetch the previous page google.protobuf.StringValue before = 2; // Contents of the current page of the listing repeated WikiPageRevision children = 3; // Number of objects in `children` // Note: Only counts immediate entries in `children` and does not count // nested objects such as comment trees google.protobuf.Int64Value dist = 4; } // String value: "Listing" string kind = 1; // The data of the wiki page revision listing. Data data = 2; } message GetWikiRevisionsRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // Revision ID // Return Revisions in the listing up to this Revision (non-inclusive) // Note: Do not use `before` and `after` in the same request google.protobuf.StringValue after = 2; // Revision ID // Return Revisions in the listing starting after this Revision (non-inclusive) // Note: Do not use `before` and `after` in the same request google.protobuf.StringValue before = 3; // The maximum number of revisions to return. google.protobuf.Int64Value limit = 4; // The number of items seen so far. // Use when fetching subsequent pages with `before` or `after`. google.protobuf.Int64Value count = 5; // (optional) Show all results regardless of user preferences google.protobuf.BoolValue show = 6; // (optional) expand subreddits google.protobuf.BoolValue sr_detail = 7; } message RevertWikiPageRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // The revision ID to revert to. string revision = 3; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 4; } message GetWikiPageSettingsRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 3; } message WikiPageSettings { message Data { // The permission level required to edit the wiki page. int32 perm_level = 1; // The users who can edit the wiki page. repeated devvit.plugin.redditapi.common.WrappedUserObject editors = 2; // Whether the wiki page is listed. bool listed = 3; } // String value: "wikipagesettings" string kind = 1; // The data of the wiki page settings. Data data = 2; } message UpdateWikiPageSettingsRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // The permission level required to edit the wiki page. // 0: Use subreddit wiki permissions // 1: Only approved wiki contributors for this page may edit // 2: Only mods may edit and view int32 permlevel = 3; // Whether the wiki page is listed. "on" to list, empty string to hide. string listed = 4; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 5; } message AllowEditorRequest { // The subreddit omitting the r/ prefix. string subreddit = 1; // The name of the wiki page. string page = 2; // Either "add" or "del". string act = 3; // The username of the user to allow or deny. string username = 4; // Which wiki version to target. Defaults to WIKI_VERSION_V1 when unspecified. WikiVersion wiki_version = 5; }