/**
 * #admin_portal.ts
 *
 * Code generated by ts-proto. DO NOT EDIT.
 * @packageDocumentation
 */
/* eslint-disable */
import _m0 from "protobufjs/minimal.js";
import { Empty } from "../../google/protobuf/empty.js";
import { Int32Value } from "../../google/protobuf/wrappers.js";
import { AddDomainsToAppRequest, AppWithDomainInfo, GetAppBySlugWithDomainInfoRequest, GetAppsWithDomainInfoRequest, GetAppsWithDomainInfoResponse, RemoveDomainFromAppRequest, } from "./app/app.js";
import { AddCuratedGameRequest, AddCuratedGameResponse, ListCuratedGamesRequest, ListCuratedGamesResponse, RemoveCuratedGameRequest, UpdateCuratedGameRankRequest, UpdateCuratedGameRankResponse, } from "./curated_game/curated_game.js";
import { GetPendingRequest, GetResponse, UpdateStatusForAppRequest, } from "./fetch_domain_request/fetch_domain_request.js";
import { FullInstallationInfo, InstallationUpgradeManyRequest, InstallationUpgradeManyResponse, InstallationUpgradeRequest, } from "./installation/installation.js";
export const AdminInstallationServiceName = "devvit.dev_portal.AdminInstallation";
export class AdminInstallationClientImpl {
    constructor(rpc, opts) {
        this.service = opts?.service || AdminInstallationServiceName;
        this.rpc = rpc;
        this.Upgrade = this.Upgrade.bind(this);
        this.UpgradeMany = this.UpgradeMany.bind(this);
    }
    Upgrade(request, metadata) {
        const data = InstallationUpgradeRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "Upgrade", data, metadata);
        return promise.then((data) => FullInstallationInfo.decode(_m0.Reader.create(data)));
    }
    UpgradeMany(request, metadata) {
        const data = InstallationUpgradeManyRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "UpgradeMany", data, metadata);
        return promise.then((data) => InstallationUpgradeManyResponse.decode(_m0.Reader.create(data)));
    }
}
export const AdminInstallationDefinition = {
    name: "AdminInstallation",
    fullName: "devvit.dev_portal.AdminInstallation",
    methods: {
        upgrade: {
            name: "Upgrade",
            requestType: InstallationUpgradeRequest,
            requestStream: false,
            responseType: FullInstallationInfo,
            responseStream: false,
            options: {},
        },
        upgradeMany: {
            name: "UpgradeMany",
            requestType: InstallationUpgradeManyRequest,
            requestStream: false,
            responseType: InstallationUpgradeManyResponse,
            responseStream: false,
            options: {},
        },
    },
};
export const AdminFetchDomainRequestServiceName = "devvit.dev_portal.AdminFetchDomainRequest";
export class AdminFetchDomainRequestClientImpl {
    constructor(rpc, opts) {
        this.service = opts?.service || AdminFetchDomainRequestServiceName;
        this.rpc = rpc;
        this.GetPending = this.GetPending.bind(this);
        this.GetPendingRequestsCount = this.GetPendingRequestsCount.bind(this);
        this.UpdateStatusForApp = this.UpdateStatusForApp.bind(this);
    }
    GetPending(request, metadata) {
        const data = GetPendingRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "GetPending", data, metadata);
        return promise.then((data) => GetResponse.decode(_m0.Reader.create(data)));
    }
    GetPendingRequestsCount(request, metadata) {
        const data = Empty.encode(request).finish();
        const promise = this.rpc.request(this.service, "GetPendingRequestsCount", data, metadata);
        return promise.then((data) => Int32Value.decode(_m0.Reader.create(data)));
    }
    UpdateStatusForApp(request, metadata) {
        const data = UpdateStatusForAppRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "UpdateStatusForApp", data, metadata);
        return promise.then((data) => Empty.decode(_m0.Reader.create(data)));
    }
}
export const AdminFetchDomainRequestDefinition = {
    name: "AdminFetchDomainRequest",
    fullName: "devvit.dev_portal.AdminFetchDomainRequest",
    methods: {
        /** Retrieves a page of fetch domain requests with status PENDING. */
        getPending: {
            name: "GetPending",
            requestType: GetPendingRequest,
            requestStream: false,
            responseType: GetResponse,
            responseStream: false,
            options: {},
        },
        /** Returns the number of fetch domain requests with status PENDING. */
        getPendingRequestsCount: {
            name: "GetPendingRequestsCount",
            requestType: Empty,
            requestStream: false,
            responseType: Int32Value,
            responseStream: false,
            options: {},
        },
        /** Updates the status of a fetch domain request for a given app. */
        updateStatusForApp: {
            name: "UpdateStatusForApp",
            requestType: UpdateStatusForAppRequest,
            requestStream: false,
            responseType: Empty,
            responseStream: false,
            options: {},
        },
    },
};
export const AdminAppServiceName = "devvit.dev_portal.AdminApp";
export class AdminAppClientImpl {
    constructor(rpc, opts) {
        this.service = opts?.service || AdminAppServiceName;
        this.rpc = rpc;
        this.GetAppBySlugWithDomainInfo = this.GetAppBySlugWithDomainInfo.bind(this);
        this.GetAppsWithDomainInfo = this.GetAppsWithDomainInfo.bind(this);
        this.AddDomainsToApp = this.AddDomainsToApp.bind(this);
        this.RemoveDomainFromApp = this.RemoveDomainFromApp.bind(this);
    }
    GetAppBySlugWithDomainInfo(request, metadata) {
        const data = GetAppBySlugWithDomainInfoRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "GetAppBySlugWithDomainInfo", data, metadata);
        return promise.then((data) => AppWithDomainInfo.decode(_m0.Reader.create(data)));
    }
    GetAppsWithDomainInfo(request, metadata) {
        const data = GetAppsWithDomainInfoRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "GetAppsWithDomainInfo", data, metadata);
        return promise.then((data) => GetAppsWithDomainInfoResponse.decode(_m0.Reader.create(data)));
    }
    AddDomainsToApp(request, metadata) {
        const data = AddDomainsToAppRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "AddDomainsToApp", data, metadata);
        return promise.then((data) => Empty.decode(_m0.Reader.create(data)));
    }
    RemoveDomainFromApp(request, metadata) {
        const data = RemoveDomainFromAppRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "RemoveDomainFromApp", data, metadata);
        return promise.then((data) => Empty.decode(_m0.Reader.create(data)));
    }
}
export const AdminAppDefinition = {
    name: "AdminApp",
    fullName: "devvit.dev_portal.AdminApp",
    methods: {
        /** Retrieves an app by slug with its fetch domain info. */
        getAppBySlugWithDomainInfo: {
            name: "GetAppBySlugWithDomainInfo",
            requestType: GetAppBySlugWithDomainInfoRequest,
            requestStream: false,
            responseType: AppWithDomainInfo,
            responseStream: false,
            options: {},
        },
        /** Retrieves a page of apps with their fetch domain info. */
        getAppsWithDomainInfo: {
            name: "GetAppsWithDomainInfo",
            requestType: GetAppsWithDomainInfoRequest,
            requestStream: false,
            responseType: GetAppsWithDomainInfoResponse,
            responseStream: false,
            options: {},
        },
        /** Adds domains to an app's allowedDomains list. */
        addDomainsToApp: {
            name: "AddDomainsToApp",
            requestType: AddDomainsToAppRequest,
            requestStream: false,
            responseType: Empty,
            responseStream: false,
            options: {},
        },
        /** Removes a domain from an app's allowedDomains list. */
        removeDomainFromApp: {
            name: "RemoveDomainFromApp",
            requestType: RemoveDomainFromAppRequest,
            requestStream: false,
            responseType: Empty,
            responseStream: false,
            options: {},
        },
    },
};
export const AdminCuratedGameServiceName = "devvit.dev_portal.AdminCuratedGame";
export class AdminCuratedGameClientImpl {
    constructor(rpc, opts) {
        this.service = opts?.service || AdminCuratedGameServiceName;
        this.rpc = rpc;
        this.ListGames = this.ListGames.bind(this);
        this.AddGame = this.AddGame.bind(this);
        this.UpdateGameRank = this.UpdateGameRank.bind(this);
        this.RemoveGame = this.RemoveGame.bind(this);
    }
    ListGames(request, metadata) {
        const data = ListCuratedGamesRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "ListGames", data, metadata);
        return promise.then((data) => ListCuratedGamesResponse.decode(_m0.Reader.create(data)));
    }
    AddGame(request, metadata) {
        const data = AddCuratedGameRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "AddGame", data, metadata);
        return promise.then((data) => AddCuratedGameResponse.decode(_m0.Reader.create(data)));
    }
    UpdateGameRank(request, metadata) {
        const data = UpdateCuratedGameRankRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "UpdateGameRank", data, metadata);
        return promise.then((data) => UpdateCuratedGameRankResponse.decode(_m0.Reader.create(data)));
    }
    RemoveGame(request, metadata) {
        const data = RemoveCuratedGameRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "RemoveGame", data, metadata);
        return promise.then((data) => Empty.decode(_m0.Reader.create(data)));
    }
}
export const AdminCuratedGameDefinition = {
    name: "AdminCuratedGame",
    fullName: "devvit.dev_portal.AdminCuratedGame",
    methods: {
        /** Lists curated game entries, optionally filtered by curation type. */
        listGames: {
            name: "ListGames",
            requestType: ListCuratedGamesRequest,
            requestStream: false,
            responseType: ListCuratedGamesResponse,
            responseStream: false,
            options: {},
        },
        /** Adds an app to a curated game list. */
        addGame: {
            name: "AddGame",
            requestType: AddCuratedGameRequest,
            requestStream: false,
            responseType: AddCuratedGameResponse,
            responseStream: false,
            options: {},
        },
        /** Updates rank for an app in the curated games list. */
        updateGameRank: {
            name: "UpdateGameRank",
            requestType: UpdateCuratedGameRankRequest,
            requestStream: false,
            responseType: UpdateCuratedGameRankResponse,
            responseStream: false,
            options: {},
        },
        /** Removes an app from the curated games list. */
        removeGame: {
            name: "RemoveGame",
            requestType: RemoveCuratedGameRequest,
            requestStream: false,
            responseType: Empty,
            responseStream: false,
            options: {},
        },
    },
};
