"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvitesModuleModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class InvitesModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('InvitesModule', 'invitesModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'InvitesModuleFilter', 'InvitesModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InvitesModule',
            fieldName: 'invitesModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('InvitesModule', 'invitesModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'InvitesModuleFilter', 'InvitesModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InvitesModule',
            fieldName: 'invitesModule',
            document,
            variables,
            transform: (data) => ({
                invitesModule: data.invitesModules?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('InvitesModule', 'invitesModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'InvitesModuleFilter', 'InvitesModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'InvitesModule',
            fieldName: 'invitesModule',
            document,
            variables,
            transform: (data) => ({
                invitesModule: data.invitesModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('InvitesModule', 'createInvitesModule', 'invitesModule', args.select, args.data, 'CreateInvitesModuleInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'InvitesModule',
            fieldName: 'createInvitesModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('InvitesModule', 'updateInvitesModule', 'invitesModule', args.select, args.where.id, args.data, 'UpdateInvitesModuleInput', 'id', 'invitesModulePatch', input_types_1.connectionFieldsMap, undefined);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'InvitesModule',
            fieldName: 'updateInvitesModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('InvitesModule', 'deleteInvitesModule', 'invitesModule', {
            id: args.where.id,
        }, 'DeleteInvitesModuleInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'InvitesModule',
            fieldName: 'deleteInvitesModule',
            document,
            variables,
        });
    }
}
exports.InvitesModuleModel = InvitesModuleModel;
