/**
 * #installation.ts
 *
 * Code generated by ts-proto. DO NOT EDIT.
 * @packageDocumentation
 */
import _m0 from "protobufjs/minimal.js";
import { ThingType } from "../../reddit/thing_type.js";
import { AppInfo } from "../app/info/app_info.js";
import { AppVersionInfo, InstallationType } from "../app_version/info/app_version_info.js";
export declare enum UpgradeStrategy {
    MANUAL = 0,
    AUTOMATIC = 1,
    UNRECOGNIZED = -1
}
export declare function upgradeStrategyFromJSON(object: any): UpgradeStrategy;
export declare function upgradeStrategyToJSON(object: UpgradeStrategy): number;
/**
 * Permissions that a moderator can grant to the app developer for an installation
 * This enum maps 1-to-1 to its Prisma equivalent in prisma/schema.prisma,
 * so they must be kept in sync
 */
export declare enum DeveloperPermissions {
    /** NONE - No permissions granted */
    NONE = 0,
    /**
     * READ_INSTALL_LOGS - Developer can stream the installation's logs and see the installation page
     * in portal, but cannot edit the installation's settings
     */
    READ_INSTALL_LOGS = 1,
    UNRECOGNIZED = -1
}
export declare function developerPermissionsFromJSON(object: any): DeveloperPermissions;
export declare function developerPermissionsToJSON(object: DeveloperPermissions): number;
export declare enum InstallationHistoryEventName {
    INSTALLED = 0,
    UNINSTALLED = 1,
    UPGRADED = 2,
    UPDATED = 3,
    BANNED = 4,
    UNBANNED = 5,
    UNRECOGNIZED = -1
}
export declare function installationHistoryEventNameFromJSON(object: any): InstallationHistoryEventName;
export declare function installationHistoryEventNameToJSON(object: InstallationHistoryEventName): number;
export interface OptionalUpgradeStrategy {
    value: UpgradeStrategy;
}
/** Used to install an app */
export interface InstallationCreationRequest {
    /** What app version are you installing? */
    appVersionId: string;
    /** Who should this app run as? If not present, will be run by the user installing the app. */
    runAs?: string | undefined;
    /** What type of install is this? */
    type: InstallationType;
    /**
     * The subreddit or user to install on. For subreddits, this is either the
     * subreddit name (**with** "r/" prefix) or its t5 ID. Eg, `r/beta` or
     * `t5_15e`. For users, this is the username (**with** "u/" prefix) or the t2 ID.
     */
    location: string;
    /** What is the installation's upgrade strategy? */
    upgradeStrategy: UpgradeStrategy;
    /** If applicable, what is the configuration for that upgrade strategy? */
    upgradeStrategyConfig?: {
        [key: string]: any;
    } | undefined;
}
/**
 * Used to update an existing installation's information.
 * If a field is optional, omitting it will leave its value unchanged.
 */
export interface InstallationUpdateRequest {
    /** What is the ID of the installation you want to change? */
    id: string;
    /** Who should this app run as? If not present, will be run by the user installing the app. */
    runAs?: string | undefined;
    /** What is the installation's upgrade strategy? */
    upgradeStrategy?: OptionalUpgradeStrategy | undefined;
    /** If applicable, what is the configuration for that upgrade strategy? */
    upgradeStrategyConfig?: {
        [key: string]: any;
    } | undefined;
    /** Disable this installation of the app? */
    isEnabled?: boolean | undefined;
    /** What permissions does the developer have for this installation? */
    developerPermissions?: DeveloperPermissions | undefined;
}
/** Used to upgrade an existing installation to a newer version. */
export interface InstallationUpgradeRequest {
    /** What is the ID of the installation you want to change? */
    id: string;
    /**
     * What version of the app are you upgrading to? (NOTE: This must be a version of
     * the same app, and must be a later version than the one currently installed.)
     * If not given, we will upgrade you to the latest non-prerelease version of the app.
     */
    appVersionId?: string | undefined;
}
export interface InstallationUpgradeManyRequest {
    /** What are the IDs of the installations you want to change? */
    ids: string[];
    /**
     * What version of the app are you upgrading them all to? (NOTE: This must be a version
     * of the same app, and must be a later version than the one currently installed.)
     */
    appVersionId: string;
}
export interface GetByAppNameAndInstallLocationRequest {
    /** What is the slug of the app you're looking for? */
    slug: string;
    /** What type of install are you looking for? */
    type: InstallationType;
    /** What is the install location? */
    location: string;
}
/** Used to get all installs in a given location */
export interface GetAllWithInstallLocationRequest {
    /** What type of install are you looking for? */
    type: InstallationType;
    /** What is the install location? */
    location: string;
}
/** Used to get all installs made by a given user */
export interface GetAllWithInstallerRequest {
    /** Whose installs are you looking for? (Can be a t2_ ID or a username, with or without `u/`) */
    installedBy: string;
}
export interface GetAllWithAppRequest {
    id: string;
    take?: number | undefined;
    skip?: number | undefined;
}
export interface GetInstallationHistoryRequest {
    /** What type of install are you looking for? */
    type: InstallationType;
    /** What is the install location? */
    location: string;
    /** What is the slug of the app you're looking for? */
    slug: string;
    /** Beginning of the time window. Leaving null implies searching from the beginning */
    from?: Date | undefined;
    /** End of the time window. Leaving null implies searching until the end */
    to?: Date | undefined;
    /** How many items to take? */
    take?: number | undefined;
    /** Order in desc order? */
    desc?: boolean | undefined;
}
/** Contains the details of an installation. For field documentation, refer to the Prisma schema. */
export interface InstallationInfo {
    id: string;
    /** string installed_by = 2; // Removed; see DX-2225 */
    upgradeStrategy: UpgradeStrategy;
    upgradeStrategyConfig?: {
        [key: string]: any;
    } | undefined;
    runAs?: string | undefined;
    type: InstallationType;
    location?: InstallationLocationInfo | undefined;
    isEnabled: boolean;
    developerPermissions: DeveloperPermissions;
}
export interface InstallationLocationInfo {
    /** Thing ID; eg, `"t5_2qh0u"` for r/pics. */
    id: string;
    /** Thing name; eg, `"pics"` for r/pics. */
    name: string;
    /** Thing type; eg, `5`, the second character in `t5_2qh0u` for r/pics. */
    type: ThingType;
    icon?: string | undefined;
    isNsfw: boolean;
    /** True if subreddit is private and the user isn't a member, or is not visible to viewer for any other reason. */
    isUnavailable: boolean;
}
/** Contains details of an installation, as well as what version was installed. */
export interface FullInstallationInfo {
    installation?: InstallationInfo | undefined;
    appVersion?: AppVersionInfo | undefined;
    app?: AppInfo | undefined;
}
/** Contains multiple installations. */
export interface MultipleInstallationsResponse {
    installations: InstallationInfo[];
}
/** Contains multiple installations and their app versions. */
export interface GetAllWithAppResponse {
    installations: InstallationWithAppVersion[];
}
/** An app installation with its matching app version info. */
export interface InstallationWithAppVersion {
    installation?: InstallationInfo | undefined;
    appVersion?: AppVersionInfo | undefined;
}
export interface InstallationUpgradeManyResponse {
    details: InstallationUpgradeManyResponse_InstallationUpgradeDetails[];
}
export interface InstallationUpgradeManyResponse_InstallationUpgradeDetails {
    id: string;
    success: boolean;
    error?: string | undefined;
}
/** Location details of an install including type of location, id, and name. (subreddit or user) */
export interface InstallationLocationDetails {
    type: InstallationType;
    /** The thing ID of the valid install location */
    thingId: string;
    /** The name of the valid install location */
    name: string;
}
export interface InstallationHistoryEvent {
    /** Who triggered this event? t2_id of the user */
    userId: string;
    /** What kind of event what it? */
    name: InstallationHistoryEventName;
    /** What are the details of the event? */
    details: {
        [key: string]: string;
    };
    /** When did this event occur? */
    createdAt?: Date | undefined;
}
export interface InstallationHistoryEvent_DetailsEntry {
    key: string;
    value: string;
}
export interface GetInstallationHistoryResponse {
    /** The events that occurred during the window specified by the request query */
    events: InstallationHistoryEvent[];
    /** Total number of events associated with the installation */
    totalEvents: number;
}
export declare const OptionalUpgradeStrategy: {
    $type: "devvit.dev_portal.installation.OptionalUpgradeStrategy";
    encode(message: OptionalUpgradeStrategy, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): OptionalUpgradeStrategy;
    fromJSON(object: any): OptionalUpgradeStrategy;
    toJSON(message: OptionalUpgradeStrategy): unknown;
    create(base?: DeepPartial<OptionalUpgradeStrategy>): OptionalUpgradeStrategy;
    fromPartial(object: DeepPartial<OptionalUpgradeStrategy>): OptionalUpgradeStrategy;
};
export declare const InstallationCreationRequest: {
    $type: "devvit.dev_portal.installation.InstallationCreationRequest";
    encode(message: InstallationCreationRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationCreationRequest;
    fromJSON(object: any): InstallationCreationRequest;
    toJSON(message: InstallationCreationRequest): unknown;
    create(base?: DeepPartial<InstallationCreationRequest>): InstallationCreationRequest;
    fromPartial(object: DeepPartial<InstallationCreationRequest>): InstallationCreationRequest;
};
export declare const InstallationUpdateRequest: {
    $type: "devvit.dev_portal.installation.InstallationUpdateRequest";
    encode(message: InstallationUpdateRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationUpdateRequest;
    fromJSON(object: any): InstallationUpdateRequest;
    toJSON(message: InstallationUpdateRequest): unknown;
    create(base?: DeepPartial<InstallationUpdateRequest>): InstallationUpdateRequest;
    fromPartial(object: DeepPartial<InstallationUpdateRequest>): InstallationUpdateRequest;
};
export declare const InstallationUpgradeRequest: {
    $type: "devvit.dev_portal.installation.InstallationUpgradeRequest";
    encode(message: InstallationUpgradeRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationUpgradeRequest;
    fromJSON(object: any): InstallationUpgradeRequest;
    toJSON(message: InstallationUpgradeRequest): unknown;
    create(base?: DeepPartial<InstallationUpgradeRequest>): InstallationUpgradeRequest;
    fromPartial(object: DeepPartial<InstallationUpgradeRequest>): InstallationUpgradeRequest;
};
export declare const InstallationUpgradeManyRequest: {
    $type: "devvit.dev_portal.installation.InstallationUpgradeManyRequest";
    encode(message: InstallationUpgradeManyRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationUpgradeManyRequest;
    fromJSON(object: any): InstallationUpgradeManyRequest;
    toJSON(message: InstallationUpgradeManyRequest): unknown;
    create(base?: DeepPartial<InstallationUpgradeManyRequest>): InstallationUpgradeManyRequest;
    fromPartial(object: DeepPartial<InstallationUpgradeManyRequest>): InstallationUpgradeManyRequest;
};
export declare const GetByAppNameAndInstallLocationRequest: {
    $type: "devvit.dev_portal.installation.GetByAppNameAndInstallLocationRequest";
    encode(message: GetByAppNameAndInstallLocationRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetByAppNameAndInstallLocationRequest;
    fromJSON(object: any): GetByAppNameAndInstallLocationRequest;
    toJSON(message: GetByAppNameAndInstallLocationRequest): unknown;
    create(base?: DeepPartial<GetByAppNameAndInstallLocationRequest>): GetByAppNameAndInstallLocationRequest;
    fromPartial(object: DeepPartial<GetByAppNameAndInstallLocationRequest>): GetByAppNameAndInstallLocationRequest;
};
export declare const GetAllWithInstallLocationRequest: {
    $type: "devvit.dev_portal.installation.GetAllWithInstallLocationRequest";
    encode(message: GetAllWithInstallLocationRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetAllWithInstallLocationRequest;
    fromJSON(object: any): GetAllWithInstallLocationRequest;
    toJSON(message: GetAllWithInstallLocationRequest): unknown;
    create(base?: DeepPartial<GetAllWithInstallLocationRequest>): GetAllWithInstallLocationRequest;
    fromPartial(object: DeepPartial<GetAllWithInstallLocationRequest>): GetAllWithInstallLocationRequest;
};
export declare const GetAllWithInstallerRequest: {
    $type: "devvit.dev_portal.installation.GetAllWithInstallerRequest";
    encode(message: GetAllWithInstallerRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetAllWithInstallerRequest;
    fromJSON(object: any): GetAllWithInstallerRequest;
    toJSON(message: GetAllWithInstallerRequest): unknown;
    create(base?: DeepPartial<GetAllWithInstallerRequest>): GetAllWithInstallerRequest;
    fromPartial(object: DeepPartial<GetAllWithInstallerRequest>): GetAllWithInstallerRequest;
};
export declare const GetAllWithAppRequest: {
    $type: "devvit.dev_portal.installation.GetAllWithAppRequest";
    encode(message: GetAllWithAppRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetAllWithAppRequest;
    fromJSON(object: any): GetAllWithAppRequest;
    toJSON(message: GetAllWithAppRequest): unknown;
    create(base?: DeepPartial<GetAllWithAppRequest>): GetAllWithAppRequest;
    fromPartial(object: DeepPartial<GetAllWithAppRequest>): GetAllWithAppRequest;
};
export declare const GetInstallationHistoryRequest: {
    $type: "devvit.dev_portal.installation.GetInstallationHistoryRequest";
    encode(message: GetInstallationHistoryRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetInstallationHistoryRequest;
    fromJSON(object: any): GetInstallationHistoryRequest;
    toJSON(message: GetInstallationHistoryRequest): unknown;
    create(base?: DeepPartial<GetInstallationHistoryRequest>): GetInstallationHistoryRequest;
    fromPartial(object: DeepPartial<GetInstallationHistoryRequest>): GetInstallationHistoryRequest;
};
export declare const InstallationInfo: {
    $type: "devvit.dev_portal.installation.InstallationInfo";
    encode(message: InstallationInfo, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationInfo;
    fromJSON(object: any): InstallationInfo;
    toJSON(message: InstallationInfo): unknown;
    create(base?: DeepPartial<InstallationInfo>): InstallationInfo;
    fromPartial(object: DeepPartial<InstallationInfo>): InstallationInfo;
};
export declare const InstallationLocationInfo: {
    $type: "devvit.dev_portal.installation.InstallationLocationInfo";
    encode(message: InstallationLocationInfo, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationLocationInfo;
    fromJSON(object: any): InstallationLocationInfo;
    toJSON(message: InstallationLocationInfo): unknown;
    create(base?: DeepPartial<InstallationLocationInfo>): InstallationLocationInfo;
    fromPartial(object: DeepPartial<InstallationLocationInfo>): InstallationLocationInfo;
};
export declare const FullInstallationInfo: {
    $type: "devvit.dev_portal.installation.FullInstallationInfo";
    encode(message: FullInstallationInfo, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): FullInstallationInfo;
    fromJSON(object: any): FullInstallationInfo;
    toJSON(message: FullInstallationInfo): unknown;
    create(base?: DeepPartial<FullInstallationInfo>): FullInstallationInfo;
    fromPartial(object: DeepPartial<FullInstallationInfo>): FullInstallationInfo;
};
export declare const MultipleInstallationsResponse: {
    $type: "devvit.dev_portal.installation.MultipleInstallationsResponse";
    encode(message: MultipleInstallationsResponse, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): MultipleInstallationsResponse;
    fromJSON(object: any): MultipleInstallationsResponse;
    toJSON(message: MultipleInstallationsResponse): unknown;
    create(base?: DeepPartial<MultipleInstallationsResponse>): MultipleInstallationsResponse;
    fromPartial(object: DeepPartial<MultipleInstallationsResponse>): MultipleInstallationsResponse;
};
export declare const GetAllWithAppResponse: {
    $type: "devvit.dev_portal.installation.GetAllWithAppResponse";
    encode(message: GetAllWithAppResponse, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetAllWithAppResponse;
    fromJSON(object: any): GetAllWithAppResponse;
    toJSON(message: GetAllWithAppResponse): unknown;
    create(base?: DeepPartial<GetAllWithAppResponse>): GetAllWithAppResponse;
    fromPartial(object: DeepPartial<GetAllWithAppResponse>): GetAllWithAppResponse;
};
export declare const InstallationWithAppVersion: {
    $type: "devvit.dev_portal.installation.InstallationWithAppVersion";
    encode(message: InstallationWithAppVersion, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationWithAppVersion;
    fromJSON(object: any): InstallationWithAppVersion;
    toJSON(message: InstallationWithAppVersion): unknown;
    create(base?: DeepPartial<InstallationWithAppVersion>): InstallationWithAppVersion;
    fromPartial(object: DeepPartial<InstallationWithAppVersion>): InstallationWithAppVersion;
};
export declare const InstallationUpgradeManyResponse: {
    $type: "devvit.dev_portal.installation.InstallationUpgradeManyResponse";
    encode(message: InstallationUpgradeManyResponse, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationUpgradeManyResponse;
    fromJSON(object: any): InstallationUpgradeManyResponse;
    toJSON(message: InstallationUpgradeManyResponse): unknown;
    create(base?: DeepPartial<InstallationUpgradeManyResponse>): InstallationUpgradeManyResponse;
    fromPartial(object: DeepPartial<InstallationUpgradeManyResponse>): InstallationUpgradeManyResponse;
};
export declare const InstallationUpgradeManyResponse_InstallationUpgradeDetails: {
    $type: "devvit.dev_portal.installation.InstallationUpgradeManyResponse.InstallationUpgradeDetails";
    encode(message: InstallationUpgradeManyResponse_InstallationUpgradeDetails, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationUpgradeManyResponse_InstallationUpgradeDetails;
    fromJSON(object: any): InstallationUpgradeManyResponse_InstallationUpgradeDetails;
    toJSON(message: InstallationUpgradeManyResponse_InstallationUpgradeDetails): unknown;
    create(base?: DeepPartial<InstallationUpgradeManyResponse_InstallationUpgradeDetails>): InstallationUpgradeManyResponse_InstallationUpgradeDetails;
    fromPartial(object: DeepPartial<InstallationUpgradeManyResponse_InstallationUpgradeDetails>): InstallationUpgradeManyResponse_InstallationUpgradeDetails;
};
export declare const InstallationLocationDetails: {
    $type: "devvit.dev_portal.installation.InstallationLocationDetails";
    encode(message: InstallationLocationDetails, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationLocationDetails;
    fromJSON(object: any): InstallationLocationDetails;
    toJSON(message: InstallationLocationDetails): unknown;
    create(base?: DeepPartial<InstallationLocationDetails>): InstallationLocationDetails;
    fromPartial(object: DeepPartial<InstallationLocationDetails>): InstallationLocationDetails;
};
export declare const InstallationHistoryEvent: {
    $type: "devvit.dev_portal.installation.InstallationHistoryEvent";
    encode(message: InstallationHistoryEvent, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationHistoryEvent;
    fromJSON(object: any): InstallationHistoryEvent;
    toJSON(message: InstallationHistoryEvent): unknown;
    create(base?: DeepPartial<InstallationHistoryEvent>): InstallationHistoryEvent;
    fromPartial(object: DeepPartial<InstallationHistoryEvent>): InstallationHistoryEvent;
};
export declare const InstallationHistoryEvent_DetailsEntry: {
    $type: "devvit.dev_portal.installation.InstallationHistoryEvent.DetailsEntry";
    encode(message: InstallationHistoryEvent_DetailsEntry, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): InstallationHistoryEvent_DetailsEntry;
    fromJSON(object: any): InstallationHistoryEvent_DetailsEntry;
    toJSON(message: InstallationHistoryEvent_DetailsEntry): unknown;
    create(base?: DeepPartial<InstallationHistoryEvent_DetailsEntry>): InstallationHistoryEvent_DetailsEntry;
    fromPartial(object: DeepPartial<InstallationHistoryEvent_DetailsEntry>): InstallationHistoryEvent_DetailsEntry;
};
export declare const GetInstallationHistoryResponse: {
    $type: "devvit.dev_portal.installation.GetInstallationHistoryResponse";
    encode(message: GetInstallationHistoryResponse, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): GetInstallationHistoryResponse;
    fromJSON(object: any): GetInstallationHistoryResponse;
    toJSON(message: GetInstallationHistoryResponse): unknown;
    create(base?: DeepPartial<GetInstallationHistoryResponse>): GetInstallationHistoryResponse;
    fromPartial(object: DeepPartial<GetInstallationHistoryResponse>): GetInstallationHistoryResponse;
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export {};
//# sourceMappingURL=installation.d.ts.map