import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder';
import { connectionFieldsMap } from '../input-types';
export class PlatformFunctionDeploymentModel {
    client;
    constructor(client) {
        this.client = client;
    }
    findMany(args) {
        const { document, variables } = buildFindManyDocument('PlatformFunctionDeployment', 'platformFunctionDeployments', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
            first: args?.first,
            last: args?.last,
            after: args?.after,
            before: args?.before,
            offset: args?.offset,
        }, 'PlatformFunctionDeploymentFilter', 'PlatformFunctionDeploymentOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformFunctionDeployment',
            fieldName: 'platformFunctionDeployments',
            document,
            variables,
        });
    }
    findFirst(args) {
        const { document, variables } = buildFindFirstDocument('PlatformFunctionDeployment', 'platformFunctionDeployments', args.select, {
            where: args?.where,
            orderBy: args?.orderBy,
        }, 'PlatformFunctionDeploymentFilter', 'PlatformFunctionDeploymentOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformFunctionDeployment',
            fieldName: 'platformFunctionDeployment',
            document,
            variables,
            transform: (data) => ({
                platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null,
            }),
        });
    }
    findOne(args) {
        const { document, variables } = buildFindManyDocument('PlatformFunctionDeployment', 'platformFunctionDeployments', args.select, {
            where: {
                id: {
                    equalTo: args.id,
                },
            },
            first: 1,
        }, 'PlatformFunctionDeploymentFilter', 'PlatformFunctionDeploymentOrderBy', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'query',
            operationName: 'PlatformFunctionDeployment',
            fieldName: 'platformFunctionDeployment',
            document,
            variables,
            transform: (data) => ({
                platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null,
            }),
        });
    }
    create(args) {
        const { document, variables } = buildCreateDocument('PlatformFunctionDeployment', 'createPlatformFunctionDeployment', 'platformFunctionDeployment', args.select, args.data, 'CreatePlatformFunctionDeploymentInput', connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PlatformFunctionDeployment',
            fieldName: 'createPlatformFunctionDeployment',
            document,
            variables,
        });
    }
    update(args) {
        const { document, variables } = buildUpdateByPkDocument('PlatformFunctionDeployment', 'updatePlatformFunctionDeployment', 'platformFunctionDeployment', args.select, args.where.id, args.data, 'UpdatePlatformFunctionDeploymentInput', 'id', 'platformFunctionDeploymentPatch', connectionFieldsMap, undefined);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PlatformFunctionDeployment',
            fieldName: 'updatePlatformFunctionDeployment',
            document,
            variables,
        });
    }
    delete(args) {
        const { document, variables } = buildDeleteByPkDocument('PlatformFunctionDeployment', 'deletePlatformFunctionDeployment', 'platformFunctionDeployment', {
            id: args.where.id,
        }, 'DeletePlatformFunctionDeploymentInput', args.select, connectionFieldsMap);
        return new QueryBuilder({
            client: this.client,
            operation: 'mutation',
            operationName: 'PlatformFunctionDeployment',
            fieldName: 'deletePlatformFunctionDeployment',
            document,
            variables,
        });
    }
}
