import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class OrgMemberProfileModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = 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', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'OrgMemberProfile',
            fieldName: 'orgMemberProfiles',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('OrgMemberProfile', 'orgMemberProfiles', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'OrgMemberProfileFilter', 'OrgMemberProfileOrderBy', connectionFieldsMap);
        return new 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 } = buildFindManyDocument('OrgMemberProfile', 'orgMemberProfiles', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'OrgMemberProfileFilter', 'OrgMemberProfileOrderBy', connectionFieldsMap);
        return new 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 } = buildCreateDocument('OrgMemberProfile', 'createOrgMemberProfile', 'orgMemberProfile', args.select, args.data, 'CreateOrgMemberProfileInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgMemberProfile',
            fieldName: 'createOrgMemberProfile',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('OrgMemberProfile', 'updateOrgMemberProfile', 'orgMemberProfile', args.select, args.where.id, args.data, 'UpdateOrgMemberProfileInput', 'id', 'orgMemberProfilePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgMemberProfile',
            fieldName: 'updateOrgMemberProfile',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('OrgMemberProfile', 'deleteOrgMemberProfile', 'orgMemberProfile', {
            id: args.where.id,
        }, 'DeleteOrgMemberProfileInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'OrgMemberProfile',
            fieldName: 'deleteOrgMemberProfile',
            document,
            variables,
        });
    }
}
