"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrgMemberProfileModel = void 0;
const query_builder_1 = require("../query-builder");
const input_types_1 = require("../input-types");
class OrgMemberProfileModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('OrgMemberProfile', 'orgMemberProfiles', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'OrgMemberProfileFilter', 'OrgMemberProfileOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgMemberProfile',
            fieldName: 'orgMemberProfiles',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('OrgMemberProfile', 'orgMemberProfiles', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'OrgMemberProfileFilter', 'OrgMemberProfileOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgMemberProfile',
            fieldName: 'orgMemberProfile',
            document,
            variables,
            transform: (data) => ({
                orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = (0, query_builder_1.buildFindManyDocument)('OrgMemberProfile', 'orgMemberProfiles', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'OrgMemberProfileFilter', 'OrgMemberProfileOrderBy', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgMemberProfile',
            fieldName: 'orgMemberProfile',
            document,
            variables,
            transform: (data) => ({
                orgMemberProfile: data.orgMemberProfiles?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = (0, query_builder_1.buildCreateDocument)('OrgMemberProfile', 'createOrgMemberProfile', 'orgMemberProfile', args.select, args.data, 'CreateOrgMemberProfileInput', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgMemberProfile',
            fieldName: 'createOrgMemberProfile',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('OrgMemberProfile', 'updateOrgMemberProfile', 'orgMemberProfile', args.select, args.where.id, args.data, 'UpdateOrgMemberProfileInput', 'id', 'orgMemberProfilePatch', input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgMemberProfile',
            fieldName: 'updateOrgMemberProfile',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('OrgMemberProfile', 'deleteOrgMemberProfile', 'orgMemberProfile', {
            id: args.where.id,
        }, 'DeleteOrgMemberProfileInput', args.select, input_types_1.connectionFieldsMap);
        return new query_builder_1.QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgMemberProfile',
            fieldName: 'deleteOrgMemberProfile',
            document,
            variables,
        });
    }
}
exports.OrgMemberProfileModel = OrgMemberProfileModel;
