import { InstallationUpgradeRequest, FullInstallationInfo, InstallationUpgradeManyRequest, InstallationUpgradeManyResponse, } from './installation/installation.js';
import { GetPendingRequest, GetResponse, UpdateStatusForAppRequest, } from './fetch_domain_request/fetch_domain_request.js';
import { Empty } from '../../google/protobuf/empty.js';
import { Int32Value } from '../../google/protobuf/wrappers.js';
import { GetAppBySlugWithDomainInfoRequest, AppWithDomainInfo, GetAppsWithDomainInfoRequest, GetAppsWithDomainInfoResponse, AddDomainsToAppRequest, RemoveDomainFromAppRequest, } from './app/app.js';
import { ListCuratedGamesRequest, ListCuratedGamesResponse, AddCuratedGameRequest, AddCuratedGameResponse, UpdateCuratedGameRankRequest, UpdateCuratedGameRankResponse, RemoveCuratedGameRequest, } from './curated_game/curated_game.js';
export class AdminInstallationClientJSON {
    constructor(rpc) {
        this.rpc = rpc;
        this.Upgrade.bind(this);
        this.UpgradeMany.bind(this);
    }
    Upgrade(request) {
        const data = InstallationUpgradeRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminInstallation', 'Upgrade', 'application/json', data);
        return promise.then((data) => FullInstallationInfo.fromJSON(data));
    }
    UpgradeMany(request) {
        const data = InstallationUpgradeManyRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminInstallation', 'UpgradeMany', 'application/json', data);
        return promise.then((data) => InstallationUpgradeManyResponse.fromJSON(data));
    }
}
export class AdminInstallationClientProtobuf {
    constructor(rpc) {
        this.rpc = rpc;
        this.Upgrade.bind(this);
        this.UpgradeMany.bind(this);
    }
    Upgrade(request) {
        const data = InstallationUpgradeRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminInstallation', 'Upgrade', 'application/protobuf', data);
        return promise.then((data) => FullInstallationInfo.decode(data));
    }
    UpgradeMany(request) {
        const data = InstallationUpgradeManyRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminInstallation', 'UpgradeMany', 'application/protobuf', data);
        return promise.then((data) => InstallationUpgradeManyResponse.decode(data));
    }
}
export class AdminFetchDomainRequestClientJSON {
    constructor(rpc) {
        this.rpc = rpc;
        this.GetPending.bind(this);
        this.GetPendingRequestsCount.bind(this);
        this.UpdateStatusForApp.bind(this);
    }
    GetPending(request) {
        const data = GetPendingRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminFetchDomainRequest', 'GetPending', 'application/json', data);
        return promise.then((data) => GetResponse.fromJSON(data));
    }
    GetPendingRequestsCount(request) {
        const data = Empty.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminFetchDomainRequest', 'GetPendingRequestsCount', 'application/json', data);
        return promise.then((data) => Int32Value.fromJSON(data));
    }
    UpdateStatusForApp(request) {
        const data = UpdateStatusForAppRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminFetchDomainRequest', 'UpdateStatusForApp', 'application/json', data);
        return promise.then((data) => Empty.fromJSON(data));
    }
}
export class AdminFetchDomainRequestClientProtobuf {
    constructor(rpc) {
        this.rpc = rpc;
        this.GetPending.bind(this);
        this.GetPendingRequestsCount.bind(this);
        this.UpdateStatusForApp.bind(this);
    }
    GetPending(request) {
        const data = GetPendingRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminFetchDomainRequest', 'GetPending', 'application/protobuf', data);
        return promise.then((data) => GetResponse.decode(data));
    }
    GetPendingRequestsCount(request) {
        const data = Empty.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminFetchDomainRequest', 'GetPendingRequestsCount', 'application/protobuf', data);
        return promise.then((data) => Int32Value.decode(data));
    }
    UpdateStatusForApp(request) {
        const data = UpdateStatusForAppRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminFetchDomainRequest', 'UpdateStatusForApp', 'application/protobuf', data);
        return promise.then((data) => Empty.decode(data));
    }
}
export class AdminAppClientJSON {
    constructor(rpc) {
        this.rpc = rpc;
        this.GetAppBySlugWithDomainInfo.bind(this);
        this.GetAppsWithDomainInfo.bind(this);
        this.AddDomainsToApp.bind(this);
        this.RemoveDomainFromApp.bind(this);
    }
    GetAppBySlugWithDomainInfo(request) {
        const data = GetAppBySlugWithDomainInfoRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'GetAppBySlugWithDomainInfo', 'application/json', data);
        return promise.then((data) => AppWithDomainInfo.fromJSON(data));
    }
    GetAppsWithDomainInfo(request) {
        const data = GetAppsWithDomainInfoRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'GetAppsWithDomainInfo', 'application/json', data);
        return promise.then((data) => GetAppsWithDomainInfoResponse.fromJSON(data));
    }
    AddDomainsToApp(request) {
        const data = AddDomainsToAppRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'AddDomainsToApp', 'application/json', data);
        return promise.then((data) => Empty.fromJSON(data));
    }
    RemoveDomainFromApp(request) {
        const data = RemoveDomainFromAppRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'RemoveDomainFromApp', 'application/json', data);
        return promise.then((data) => Empty.fromJSON(data));
    }
}
export class AdminAppClientProtobuf {
    constructor(rpc) {
        this.rpc = rpc;
        this.GetAppBySlugWithDomainInfo.bind(this);
        this.GetAppsWithDomainInfo.bind(this);
        this.AddDomainsToApp.bind(this);
        this.RemoveDomainFromApp.bind(this);
    }
    GetAppBySlugWithDomainInfo(request) {
        const data = GetAppBySlugWithDomainInfoRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'GetAppBySlugWithDomainInfo', 'application/protobuf', data);
        return promise.then((data) => AppWithDomainInfo.decode(data));
    }
    GetAppsWithDomainInfo(request) {
        const data = GetAppsWithDomainInfoRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'GetAppsWithDomainInfo', 'application/protobuf', data);
        return promise.then((data) => GetAppsWithDomainInfoResponse.decode(data));
    }
    AddDomainsToApp(request) {
        const data = AddDomainsToAppRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'AddDomainsToApp', 'application/protobuf', data);
        return promise.then((data) => Empty.decode(data));
    }
    RemoveDomainFromApp(request) {
        const data = RemoveDomainFromAppRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminApp', 'RemoveDomainFromApp', 'application/protobuf', data);
        return promise.then((data) => Empty.decode(data));
    }
}
export class AdminCuratedGameClientJSON {
    constructor(rpc) {
        this.rpc = rpc;
        this.ListGames.bind(this);
        this.AddGame.bind(this);
        this.UpdateGameRank.bind(this);
        this.RemoveGame.bind(this);
    }
    ListGames(request) {
        const data = ListCuratedGamesRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'ListGames', 'application/json', data);
        return promise.then((data) => ListCuratedGamesResponse.fromJSON(data));
    }
    AddGame(request) {
        const data = AddCuratedGameRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'AddGame', 'application/json', data);
        return promise.then((data) => AddCuratedGameResponse.fromJSON(data));
    }
    UpdateGameRank(request) {
        const data = UpdateCuratedGameRankRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'UpdateGameRank', 'application/json', data);
        return promise.then((data) => UpdateCuratedGameRankResponse.fromJSON(data));
    }
    RemoveGame(request) {
        const data = RemoveCuratedGameRequest.toJSON(request);
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'RemoveGame', 'application/json', data);
        return promise.then((data) => Empty.fromJSON(data));
    }
}
export class AdminCuratedGameClientProtobuf {
    constructor(rpc) {
        this.rpc = rpc;
        this.ListGames.bind(this);
        this.AddGame.bind(this);
        this.UpdateGameRank.bind(this);
        this.RemoveGame.bind(this);
    }
    ListGames(request) {
        const data = ListCuratedGamesRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'ListGames', 'application/protobuf', data);
        return promise.then((data) => ListCuratedGamesResponse.decode(data));
    }
    AddGame(request) {
        const data = AddCuratedGameRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'AddGame', 'application/protobuf', data);
        return promise.then((data) => AddCuratedGameResponse.decode(data));
    }
    UpdateGameRank(request) {
        const data = UpdateCuratedGameRankRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'UpdateGameRank', 'application/protobuf', data);
        return promise.then((data) => UpdateCuratedGameRankResponse.decode(data));
    }
    RemoveGame(request) {
        const data = RemoveCuratedGameRequest.encode(request).finish();
        const promise = this.rpc.request('devvit.dev_portal.AdminCuratedGame', 'RemoveGame', 'application/protobuf', data);
        return promise.then((data) => Empty.decode(data));
    }
}
