"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserConnectedAccountModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class UserConnectedAccountModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('UserConnectedAccount', 'userConnectedAccounts', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'UserConnectedAccountFilter', 'UserConnectedAccountOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'UserConnectedAccount',
            fieldName: 'userConnectedAccounts',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('UserConnectedAccount', 'userConnectedAccounts', args.select, {
            where: args?.where,
        }, 'UserConnectedAccountFilter', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'UserConnectedAccount',
            fieldName: 'userConnectedAccounts',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('UserConnectedAccount', 'userConnectedAccounts', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'UserConnectedAccountFilter', 'UserConnectedAccountOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'UserConnectedAccount',
            fieldName: 'userConnectedAccount',
            document,
            variables,
            transform: (data) => ({
                userConnectedAccount: data.userConnectedAccounts?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('UserConnectedAccount', 'createUserConnectedAccount', 'userConnectedAccount', args.select, args.data, 'CreateUserConnectedAccountInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'UserConnectedAccount',
            fieldName: 'createUserConnectedAccount',
            document,
            variables,
        });
    }
}
exports.UserConnectedAccountModel = UserConnectedAccountModel;
