import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class NotificationsModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('NotificationsModule', 'notificationsModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'NotificationsModuleFilter', 'NotificationsModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'NotificationsModule',
            fieldName: 'notificationsModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('NotificationsModule', 'notificationsModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'NotificationsModuleFilter', 'NotificationsModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'NotificationsModule',
            fieldName: 'notificationsModule',
            document,
            variables,
            transform: (data) => ({
                notificationsModule: data.notificationsModules?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('NotificationsModule', 'notificationsModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'NotificationsModuleFilter', 'NotificationsModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'NotificationsModule',
            fieldName: 'notificationsModule',
            document,
            variables,
            transform: (data) => ({
                notificationsModule: data.notificationsModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('NotificationsModule', 'createNotificationsModule', 'notificationsModule', args.select, args.data, 'CreateNotificationsModuleInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'NotificationsModule',
            fieldName: 'createNotificationsModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('NotificationsModule', 'updateNotificationsModule', 'notificationsModule', args.select, args.where.id, args.data, 'UpdateNotificationsModuleInput', 'id', 'notificationsModulePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'NotificationsModule',
            fieldName: 'updateNotificationsModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('NotificationsModule', 'deleteNotificationsModule', 'notificationsModule', {
            id: args.where.id,
        }, 'DeleteNotificationsModuleInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'NotificationsModule',
            fieldName: 'deleteNotificationsModule',
            document,
            variables,
        });
    }
}
