import { Prisma } from '../../../prisma-client';
import type { SelectedCalendarEventTypeIds } from "@calcom/types/Calendar";
export type UpdateArguments = {
    where: FindManyArgs["where"];
    data: Prisma.SelectedCalendarUpdateManyArgs["data"];
};
export type FindManyArgs = {
    where?: {
        userId?: number | {
            in: number[];
        };
        credentialId?: number | null;
        integration?: string;
        externalId?: string;
        eventTypeId?: number | null;
        googleChannelId?: string | null | {
            not: null;
        };
    };
    orderBy?: {
        userId?: "asc" | "desc";
    };
    select?: Prisma.SelectedCalendarSelect;
};
export declare class SelectedCalendarRepository {
    private static findConflicting;
    static findById(id: string): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    } | null>;
    static create(data: Prisma.SelectedCalendarUncheckedCreateInput): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static upsert(data: Prisma.SelectedCalendarUncheckedCreateInput): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static delete({ where }: {
        where: Prisma.SelectedCalendarUncheckedCreateInput;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static createIfNotExists(data: Prisma.SelectedCalendarUncheckedCreateInput): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    /** Retrieve calendars that need to be watched */
    static getNextBatchToWatch(limit?: number): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }[]>;
    /**
     * Retrieve calendars that are being watched but shouldn't be anymore
     * e.g. when a user disables calendar cache for the organization
     */
    static getNextBatchToUnwatch(limit?: number): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }[]>;
    static findMany({ where, select, orderBy }: FindManyArgs): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }[]>;
    static findUniqueOrThrow({ where }: {
        where: Prisma.SelectedCalendarWhereInput;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static findFirstByGoogleChannelId(googleChannelId: string): Promise<{
        credential: {
            key: Prisma.JsonValue;
            user: {
                email: string;
            } | null;
            id: number;
            type: string;
            userId: number | null;
            teamId: number | null;
            selectedCalendars: {
                error: string | null;
                id: string;
                userId: number;
                credentialId: number | null;
                eventTypeId: number | null;
                integration: string;
                externalId: string;
                delegationCredentialId: string | null;
                domainWideDelegationCredentialId: string | null;
                googleChannelId: string | null;
                googleChannelKind: string | null;
                googleChannelResourceId: string | null;
                googleChannelResourceUri: string | null;
                googleChannelExpiration: string | null;
            }[];
            appId: string | null;
            invalid: boolean | null;
        } | null;
    } | null>;
    static findFirst({ where }: {
        where: Prisma.SelectedCalendarWhereInput;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    } | null>;
    static findFirstOrThrow({ where }: {
        where: Prisma.SelectedCalendarWhereInput;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static update(args: UpdateArguments): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    /**
     * Following methods ensure that they operate on user level calendars only
     */
    static findUserLevelUniqueOrThrow({ where }: {
        where: Prisma.SelectedCalendarWhereInput;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static findManyUserLevel(args: FindManyArgs): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }[]>;
    static updateUserLevel(args: UpdateArguments): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static deleteUserLevel({ where }: {
        where: Prisma.SelectedCalendarUncheckedCreateInput;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
    static upsertManyForEventTypeIds({ data, eventTypeIds, }: {
        data: Prisma.SelectedCalendarUncheckedCreateInput;
        eventTypeIds: SelectedCalendarEventTypeIds;
    }): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }[]>;
    static updateById(id: string, data: Prisma.SelectedCalendarUpdateInput): Promise<{
        error: string | null;
        id: string;
        userId: number;
        credentialId: number | null;
        eventTypeId: number | null;
        integration: string;
        externalId: string;
        delegationCredentialId: string | null;
        domainWideDelegationCredentialId: string | null;
        googleChannelId: string | null;
        googleChannelKind: string | null;
        googleChannelResourceId: string | null;
        googleChannelResourceUri: string | null;
        googleChannelExpiration: string | null;
    }>;
}
//# sourceMappingURL=selectedCalendar.d.ts.map