/**
 * #installation.ts
 *
 * Code generated by ts-proto. DO NOT EDIT.
 * @packageDocumentation
 */
import type { ThingType } from "../../reddit/thing_type.js";
import type { AppInfo } from "../app/info/app_info.js";
import type { AppVersionInfo, InstallationType } from "../app_version/info/app_version_info.js";
export declare enum UpgradeStrategy {
    MANUAL = 0,
    AUTOMATIC = 1,
    UNRECOGNIZED = -1
}
/**
 * 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 enum InstallationHistoryEventName {
    INSTALLED = 0,
    UNINSTALLED = 1,
    UPGRADED = 2,
    UPDATED = 3,
    BANNED = 4,
    UNBANNED = 5,
    UNRECOGNIZED = -1
}
export type OptionalUpgradeStrategy = {
    value: UpgradeStrategy;
};
/** Used to install an app */
export type 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 type 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 type 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 type 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 type 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 type 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 type GetAllWithInstallerRequest = {
    /** Whose installs are you looking for? (Can be a t2_ ID or a username, with or without `u/`) */
    installedBy: string;
};
export type GetAllWithAppRequest = {
    id: string;
    take?: number | undefined;
    skip?: number | undefined;
};
export type 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?: string | undefined;
    /** End of the time window. Leaving null implies searching until the end */
    to?: string | 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 type 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 type 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 type FullInstallationInfo = {
    installation?: InstallationInfo | undefined;
    appVersion?: AppVersionInfo | undefined;
    app?: AppInfo | undefined;
};
/** Contains multiple installations. */
export type MultipleInstallationsResponse = {
    installations: InstallationInfo[];
};
/** Contains multiple installations and their app versions. */
export type GetAllWithAppResponse = {
    installations: InstallationWithAppVersion[];
};
/** An app installation with its matching app version info. */
export type InstallationWithAppVersion = {
    installation?: InstallationInfo | undefined;
    appVersion?: AppVersionInfo | undefined;
};
export type InstallationUpgradeManyResponse = {
    details: InstallationUpgradeManyResponse_InstallationUpgradeDetails[];
};
export type 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 type InstallationLocationDetails = {
    type: InstallationType;
    /** The thing ID of the valid install location */
    thingId: string;
    /** The name of the valid install location */
    name: string;
};
export type 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?: string | undefined;
};
export type InstallationHistoryEvent_DetailsEntry = {
    key: string;
    value: string;
};
export type 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;
};
//# sourceMappingURL=installation.d.ts.map