import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class SessionSecretsModuleModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('SessionSecretsModule', 'sessionSecretsModules', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'SessionSecretsModuleFilter', 'SessionSecretsModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'SessionSecretsModule',
            fieldName: 'sessionSecretsModules',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('SessionSecretsModule', 'sessionSecretsModules', args.select, {
            where: args?.where,
        }, 'SessionSecretsModuleFilter', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'SessionSecretsModule',
            fieldName: 'sessionSecretsModules',
            document,
            variables,
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('SessionSecretsModule', 'sessionSecretsModules', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'SessionSecretsModuleFilter', 'SessionSecretsModuleOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'SessionSecretsModule',
            fieldName: 'sessionSecretsModule',
            document,
            variables,
            transform: (data) => ({
                sessionSecretsModule: data.sessionSecretsModules?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('SessionSecretsModule', 'createSessionSecretsModule', 'sessionSecretsModule', args.select, args.data, 'CreateSessionSecretsModuleInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'SessionSecretsModule',
            fieldName: 'createSessionSecretsModule',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('SessionSecretsModule', 'updateSessionSecretsModule', 'sessionSecretsModule', args.select, args.where.id, args.data, 'UpdateSessionSecretsModuleInput', 'id', 'sessionSecretsModulePatch', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'SessionSecretsModule',
            fieldName: 'updateSessionSecretsModule',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('SessionSecretsModule', 'deleteSessionSecretsModule', 'sessionSecretsModule', {
            id: args.where.id,
        }, 'DeleteSessionSecretsModuleInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'SessionSecretsModule',
            fieldName: 'deleteSessionSecretsModule',
            document,
            variables,
        });
    }
}
