import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class PubkeySettingModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('PubkeySetting', 'pubkeySettings', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'PubkeySettingFilter', 'PubkeySettingOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PubkeySetting',
            fieldName: 'pubkeySettings',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('PubkeySetting', 'pubkeySettings', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'PubkeySettingFilter', 'PubkeySettingOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PubkeySetting',
            fieldName: 'pubkeySetting',
            document,
            variables,
            transform: (data) => ({
                pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('PubkeySetting', 'pubkeySettings', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'PubkeySettingFilter', 'PubkeySettingOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PubkeySetting',
            fieldName: 'pubkeySetting',
            document,
            variables,
            transform: (data) => ({
                pubkeySetting: data.pubkeySettings?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('PubkeySetting', 'createPubkeySetting', 'pubkeySetting', args.select, args.data, 'CreatePubkeySettingInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PubkeySetting',
            fieldName: 'createPubkeySetting',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('PubkeySetting', 'updatePubkeySetting', 'pubkeySetting', args.select, args.where.id, args.data, 'UpdatePubkeySettingInput', 'id', 'pubkeySettingPatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PubkeySetting',
            fieldName: 'updatePubkeySetting',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('PubkeySetting', 'deletePubkeySetting', 'pubkeySetting', {
            id: args.where.id,
        }, 'DeletePubkeySettingInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PubkeySetting',
            fieldName: 'deletePubkeySetting',
            document,
            variables,
        });
    }
}
