"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserAuthModuleModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class UserAuthModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('UserAuthModule', 'userAuthModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'UserAuthModuleFilter', 'UserAuthModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'UserAuthModule',
            fieldName: 'userAuthModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('UserAuthModule', 'userAuthModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'UserAuthModuleFilter', 'UserAuthModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'UserAuthModule',
            fieldName: 'userAuthModule',
            document,
            variables,
            transform: (data) => ({
                userAuthModule: data.userAuthModules?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('UserAuthModule', 'userAuthModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'UserAuthModuleFilter', 'UserAuthModuleOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'UserAuthModule',
            fieldName: 'userAuthModule',
            document,
            variables,
            transform: (data) => ({
                userAuthModule: data.userAuthModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('UserAuthModule', 'createUserAuthModule', 'userAuthModule', args.select, args.data, 'CreateUserAuthModuleInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'UserAuthModule',
            fieldName: 'createUserAuthModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('UserAuthModule', 'updateUserAuthModule', 'userAuthModule', args.select, args.where.id, args.data, 'UpdateUserAuthModuleInput', 'id', 'userAuthModulePatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'UserAuthModule',
            fieldName: 'updateUserAuthModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('UserAuthModule', 'deleteUserAuthModule', 'userAuthModule', {
            id: args.where.id,
        }, 'DeleteUserAuthModuleInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'UserAuthModule',
            fieldName: 'deleteUserAuthModule',
            document,
            variables,
        });
    }
}
exports.UserAuthModuleModel = UserAuthModuleModel;
