import { AboutWhereRequest, BasicSubredditRequest, DeleteSrImgRequest, BasicSearchRequest, SearchRedditNamesResponse, SearchSubredditsResponse, SiteAdminRequest, SubmitTextResponse, SubredditAutocompleteRequest, SubredditAutocompleteResponse, SubredditStylesheetRequest, SubscribeRequest, UploadSrImgRequest, UploadSrImgResponse, SubredditPostRequirementsResponse, SubredditAboutResponse, SubredditAboutEditRequest, SubredditAboutEditResponse, SubredditAboutRulesResponse, SubredditAboutTrafficResponse, StickyRequest, StickyResponse, BasicWhereRequest, SubredditsSearchRequest, SubredditsSearchResponse, UsersSearchRequest, UserSearchResponse, SubredditAddRemovalReasonRequest, SubredditAddRemovalReasonResponse, SubredditGetRemovalReasonsRequest, SubredditGetRemovalReasonsResponse, GetHighlightedPostsRequest, GetHighlightedPostsResponse, ReorderHighlightedPostsRequest, ReorderHighlightedPostsResponse, } from './subreddits_msg.js';
import { Listing, JsonStatus } from '../common/common_msg.js';
import { Empty } from '../../../../google/protobuf/empty.js';
import { StringValue } from '../../../../google/protobuf/wrappers.js';
export class SubredditsClientJSON {
    constructor(rpc) {
        this.rpc = rpc;
        this.AboutWhere.bind(this);
        this.DeleteSrBanner.bind(this);
        this.DeleteSrHeader.bind(this);
        this.DeleteSrIcon.bind(this);
        this.DeleteSrImg.bind(this);
        this.SearchRedditNames.bind(this);
        this.SearchSubreddits.bind(this);
        this.SiteAdmin.bind(this);
        this.SubmitText.bind(this);
        this.SubredditAutocomplete.bind(this);
        this.SubredditStylesheet.bind(this);
        this.Subscribe.bind(this);
        this.UploadSrImg.bind(this);
        this.SubredditPostRequirements.bind(this);
        this.SubredditAbout.bind(this);
        this.SubredditAboutEdit.bind(this);
        this.SubredditAboutRules.bind(this);
        this.SubredditAboutTraffic.bind(this);
        this.Sidebar.bind(this);
        this.Sticky.bind(this);
        this.SubredditsMineWhere.bind(this);
        this.SubredditsSearch.bind(this);
        this.SubredditsWhere.bind(this);
        this.UsersSearch.bind(this);
        this.UsersWhere.bind(this);
        this.SubredditAddRemovalReason.bind(this);
        this.SubredditGetRemovalReasons.bind(this);
        this.GetHighlightedPosts.bind(this);
        this.ReorderHighlightedPosts.bind(this);
    }
    AboutWhere(request) {
        const data = AboutWhereRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'AboutWhere', 'application/json', data);
        return promise.then((data) => Listing.fromJSON(data));
    }
    DeleteSrBanner(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrBanner', 'application/json', data);
        return promise.then((data) => JsonStatus.fromJSON(data));
    }
    DeleteSrHeader(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrHeader', 'application/json', data);
        return promise.then((data) => JsonStatus.fromJSON(data));
    }
    DeleteSrIcon(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrIcon', 'application/json', data);
        return promise.then((data) => JsonStatus.fromJSON(data));
    }
    DeleteSrImg(request) {
        const data = DeleteSrImgRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrImg', 'application/json', data);
        return promise.then((data) => JsonStatus.fromJSON(data));
    }
    SearchRedditNames(request) {
        const data = BasicSearchRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SearchRedditNames', 'application/json', data);
        return promise.then((data) => SearchRedditNamesResponse.fromJSON(data));
    }
    SearchSubreddits(request) {
        const data = BasicSearchRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SearchSubreddits', 'application/json', data);
        return promise.then((data) => SearchSubredditsResponse.fromJSON(data));
    }
    SiteAdmin(request) {
        const data = SiteAdminRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SiteAdmin', 'application/json', data);
        return promise.then((data) => JsonStatus.fromJSON(data));
    }
    SubmitText(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubmitText', 'application/json', data);
        return promise.then((data) => SubmitTextResponse.fromJSON(data));
    }
    SubredditAutocomplete(request) {
        const data = SubredditAutocompleteRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAutocomplete', 'application/json', data);
        return promise.then((data) => SubredditAutocompleteResponse.fromJSON(data));
    }
    SubredditStylesheet(request) {
        const data = SubredditStylesheetRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditStylesheet', 'application/json', data);
        return promise.then((data) => JsonStatus.fromJSON(data));
    }
    Subscribe(request) {
        const data = SubscribeRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'Subscribe', 'application/json', data);
        return promise.then((data) => Empty.fromJSON(data));
    }
    UploadSrImg(request) {
        const data = UploadSrImgRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'UploadSrImg', 'application/json', data);
        return promise.then((data) => UploadSrImgResponse.fromJSON(data));
    }
    SubredditPostRequirements(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditPostRequirements', 'application/json', data);
        return promise.then((data) => SubredditPostRequirementsResponse.fromJSON(data));
    }
    SubredditAbout(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAbout', 'application/json', data);
        return promise.then((data) => SubredditAboutResponse.fromJSON(data));
    }
    SubredditAboutEdit(request) {
        const data = SubredditAboutEditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAboutEdit', 'application/json', data);
        return promise.then((data) => SubredditAboutEditResponse.fromJSON(data));
    }
    SubredditAboutRules(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAboutRules', 'application/json', data);
        return promise.then((data) => SubredditAboutRulesResponse.fromJSON(data));
    }
    SubredditAboutTraffic(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAboutTraffic', 'application/json', data);
        return promise.then((data) => SubredditAboutTrafficResponse.fromJSON(data));
    }
    Sidebar(request) {
        const data = BasicSubredditRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'Sidebar', 'application/json', data);
        return promise.then((data) => StringValue.fromJSON(data));
    }
    Sticky(request) {
        const data = StickyRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'Sticky', 'application/json', data);
        return promise.then((data) => StickyResponse.fromJSON(data));
    }
    SubredditsMineWhere(request) {
        const data = BasicWhereRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditsMineWhere', 'application/json', data);
        return promise.then((data) => Listing.fromJSON(data));
    }
    SubredditsSearch(request) {
        const data = SubredditsSearchRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditsSearch', 'application/json', data);
        return promise.then((data) => SubredditsSearchResponse.fromJSON(data));
    }
    SubredditsWhere(request) {
        const data = BasicWhereRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditsWhere', 'application/json', data);
        return promise.then((data) => SubredditsSearchResponse.fromJSON(data));
    }
    UsersSearch(request) {
        const data = UsersSearchRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'UsersSearch', 'application/json', data);
        return promise.then((data) => UserSearchResponse.fromJSON(data));
    }
    UsersWhere(request) {
        const data = BasicWhereRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'UsersWhere', 'application/json', data);
        return promise.then((data) => SubredditsSearchResponse.fromJSON(data));
    }
    SubredditAddRemovalReason(request) {
        const data = SubredditAddRemovalReasonRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAddRemovalReason', 'application/json', data);
        return promise.then((data) => SubredditAddRemovalReasonResponse.fromJSON(data));
    }
    SubredditGetRemovalReasons(request) {
        const data = SubredditGetRemovalReasonsRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditGetRemovalReasons', 'application/json', data);
        return promise.then((data) => SubredditGetRemovalReasonsResponse.fromJSON(data));
    }
    GetHighlightedPosts(request) {
        const data = GetHighlightedPostsRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'GetHighlightedPosts', 'application/json', data);
        return promise.then((data) => GetHighlightedPostsResponse.fromJSON(data));
    }
    ReorderHighlightedPosts(request) {
        const data = ReorderHighlightedPostsRequest.toJSON(request);
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'ReorderHighlightedPosts', 'application/json', data);
        return promise.then((data) => ReorderHighlightedPostsResponse.fromJSON(data));
    }
}
export class SubredditsClientProtobuf {
    constructor(rpc) {
        this.rpc = rpc;
        this.AboutWhere.bind(this);
        this.DeleteSrBanner.bind(this);
        this.DeleteSrHeader.bind(this);
        this.DeleteSrIcon.bind(this);
        this.DeleteSrImg.bind(this);
        this.SearchRedditNames.bind(this);
        this.SearchSubreddits.bind(this);
        this.SiteAdmin.bind(this);
        this.SubmitText.bind(this);
        this.SubredditAutocomplete.bind(this);
        this.SubredditStylesheet.bind(this);
        this.Subscribe.bind(this);
        this.UploadSrImg.bind(this);
        this.SubredditPostRequirements.bind(this);
        this.SubredditAbout.bind(this);
        this.SubredditAboutEdit.bind(this);
        this.SubredditAboutRules.bind(this);
        this.SubredditAboutTraffic.bind(this);
        this.Sidebar.bind(this);
        this.Sticky.bind(this);
        this.SubredditsMineWhere.bind(this);
        this.SubredditsSearch.bind(this);
        this.SubredditsWhere.bind(this);
        this.UsersSearch.bind(this);
        this.UsersWhere.bind(this);
        this.SubredditAddRemovalReason.bind(this);
        this.SubredditGetRemovalReasons.bind(this);
        this.GetHighlightedPosts.bind(this);
        this.ReorderHighlightedPosts.bind(this);
    }
    AboutWhere(request) {
        const data = AboutWhereRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'AboutWhere', 'application/protobuf', data);
        return promise.then((data) => Listing.decode(data));
    }
    DeleteSrBanner(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrBanner', 'application/protobuf', data);
        return promise.then((data) => JsonStatus.decode(data));
    }
    DeleteSrHeader(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrHeader', 'application/protobuf', data);
        return promise.then((data) => JsonStatus.decode(data));
    }
    DeleteSrIcon(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrIcon', 'application/protobuf', data);
        return promise.then((data) => JsonStatus.decode(data));
    }
    DeleteSrImg(request) {
        const data = DeleteSrImgRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'DeleteSrImg', 'application/protobuf', data);
        return promise.then((data) => JsonStatus.decode(data));
    }
    SearchRedditNames(request) {
        const data = BasicSearchRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SearchRedditNames', 'application/protobuf', data);
        return promise.then((data) => SearchRedditNamesResponse.decode(data));
    }
    SearchSubreddits(request) {
        const data = BasicSearchRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SearchSubreddits', 'application/protobuf', data);
        return promise.then((data) => SearchSubredditsResponse.decode(data));
    }
    SiteAdmin(request) {
        const data = SiteAdminRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SiteAdmin', 'application/protobuf', data);
        return promise.then((data) => JsonStatus.decode(data));
    }
    SubmitText(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubmitText', 'application/protobuf', data);
        return promise.then((data) => SubmitTextResponse.decode(data));
    }
    SubredditAutocomplete(request) {
        const data = SubredditAutocompleteRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAutocomplete', 'application/protobuf', data);
        return promise.then((data) => SubredditAutocompleteResponse.decode(data));
    }
    SubredditStylesheet(request) {
        const data = SubredditStylesheetRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditStylesheet', 'application/protobuf', data);
        return promise.then((data) => JsonStatus.decode(data));
    }
    Subscribe(request) {
        const data = SubscribeRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'Subscribe', 'application/protobuf', data);
        return promise.then((data) => Empty.decode(data));
    }
    UploadSrImg(request) {
        const data = UploadSrImgRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'UploadSrImg', 'application/protobuf', data);
        return promise.then((data) => UploadSrImgResponse.decode(data));
    }
    SubredditPostRequirements(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditPostRequirements', 'application/protobuf', data);
        return promise.then((data) => SubredditPostRequirementsResponse.decode(data));
    }
    SubredditAbout(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAbout', 'application/protobuf', data);
        return promise.then((data) => SubredditAboutResponse.decode(data));
    }
    SubredditAboutEdit(request) {
        const data = SubredditAboutEditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAboutEdit', 'application/protobuf', data);
        return promise.then((data) => SubredditAboutEditResponse.decode(data));
    }
    SubredditAboutRules(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAboutRules', 'application/protobuf', data);
        return promise.then((data) => SubredditAboutRulesResponse.decode(data));
    }
    SubredditAboutTraffic(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAboutTraffic', 'application/protobuf', data);
        return promise.then((data) => SubredditAboutTrafficResponse.decode(data));
    }
    Sidebar(request) {
        const data = BasicSubredditRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'Sidebar', 'application/protobuf', data);
        return promise.then((data) => StringValue.decode(data));
    }
    Sticky(request) {
        const data = StickyRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'Sticky', 'application/protobuf', data);
        return promise.then((data) => StickyResponse.decode(data));
    }
    SubredditsMineWhere(request) {
        const data = BasicWhereRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditsMineWhere', 'application/protobuf', data);
        return promise.then((data) => Listing.decode(data));
    }
    SubredditsSearch(request) {
        const data = SubredditsSearchRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditsSearch', 'application/protobuf', data);
        return promise.then((data) => SubredditsSearchResponse.decode(data));
    }
    SubredditsWhere(request) {
        const data = BasicWhereRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditsWhere', 'application/protobuf', data);
        return promise.then((data) => SubredditsSearchResponse.decode(data));
    }
    UsersSearch(request) {
        const data = UsersSearchRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'UsersSearch', 'application/protobuf', data);
        return promise.then((data) => UserSearchResponse.decode(data));
    }
    UsersWhere(request) {
        const data = BasicWhereRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'UsersWhere', 'application/protobuf', data);
        return promise.then((data) => SubredditsSearchResponse.decode(data));
    }
    SubredditAddRemovalReason(request) {
        const data = SubredditAddRemovalReasonRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditAddRemovalReason', 'application/protobuf', data);
        return promise.then((data) => SubredditAddRemovalReasonResponse.decode(data));
    }
    SubredditGetRemovalReasons(request) {
        const data = SubredditGetRemovalReasonsRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'SubredditGetRemovalReasons', 'application/protobuf', data);
        return promise.then((data) => SubredditGetRemovalReasonsResponse.decode(data));
    }
    GetHighlightedPosts(request) {
        const data = GetHighlightedPostsRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'GetHighlightedPosts', 'application/protobuf', data);
        return promise.then((data) => GetHighlightedPostsResponse.decode(data));
    }
    ReorderHighlightedPosts(request) {
        const data = ReorderHighlightedPostsRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.plugin.redditapi.subreddits.Subreddits', 'ReorderHighlightedPosts', 'application/protobuf', data);
        return promise.then((data) => ReorderHighlightedPostsResponse.decode(data));
    }
}
