import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../wayfinder'
/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
export const index = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

index.definition = {
    methods: ["get","head"],
    url: '/fuzzy-operations',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::index
* @see app/Http/Controllers/UserOperationController.php:101
* @route '/fuzzy-operations'
*/
indexForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

index.form = indexForm

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
export const create = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

create.definition = {
    methods: ["get","head"],
    url: '/fuzzy-operations/add-operations',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
create.url = (options?: RouteQueryOptions) => {
    return create.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
create.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
create.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: create.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
const createForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
createForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::create
* @see app/Http/Controllers/UserOperationController.php:114
* @route '/fuzzy-operations/add-operations'
*/
createForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

create.form = createForm

/**
* @see \App\Http\Controllers\UserOperationController::store
* @see app/Http/Controllers/UserOperationController.php:134
* @route '/fuzzy-operations/add-operations'
*/
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

store.definition = {
    methods: ["post"],
    url: '/fuzzy-operations/add-operations',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\UserOperationController::store
* @see app/Http/Controllers/UserOperationController.php:134
* @route '/fuzzy-operations/add-operations'
*/
store.url = (options?: RouteQueryOptions) => {
    return store.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::store
* @see app/Http/Controllers/UserOperationController.php:134
* @route '/fuzzy-operations/add-operations'
*/
store.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UserOperationController::store
* @see app/Http/Controllers/UserOperationController.php:134
* @route '/fuzzy-operations/add-operations'
*/
const storeForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UserOperationController::store
* @see app/Http/Controllers/UserOperationController.php:134
* @route '/fuzzy-operations/add-operations'
*/
storeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

store.form = storeForm

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
export const edit = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

edit.definition = {
    methods: ["get","head"],
    url: '/fuzzy-operations/edit-operations/{userOperation}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
edit.url = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { userOperation: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { userOperation: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            userOperation: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        userOperation: typeof args.userOperation === 'object'
        ? args.userOperation.id
        : args.userOperation,
    }

    return edit.definition.url
            .replace('{userOperation}', parsedArgs.userOperation.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
edit.get = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
edit.head = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: edit.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
const editForm = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
editForm.get = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::edit
* @see app/Http/Controllers/UserOperationController.php:171
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
editForm.head = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: edit.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

edit.form = editForm

/**
* @see \App\Http\Controllers\UserOperationController::update
* @see app/Http/Controllers/UserOperationController.php:187
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
export const update = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

update.definition = {
    methods: ["put"],
    url: '/fuzzy-operations/edit-operations/{userOperation}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\UserOperationController::update
* @see app/Http/Controllers/UserOperationController.php:187
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
update.url = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { userOperation: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { userOperation: args.id }
    }

    if (Array.isArray(args)) {
        args = {
            userOperation: args[0],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        userOperation: typeof args.userOperation === 'object'
        ? args.userOperation.id
        : args.userOperation,
    }

    return update.definition.url
            .replace('{userOperation}', parsedArgs.userOperation.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::update
* @see app/Http/Controllers/UserOperationController.php:187
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
update.put = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

/**
* @see \App\Http\Controllers\UserOperationController::update
* @see app/Http/Controllers/UserOperationController.php:187
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
const updateForm = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UserOperationController::update
* @see app/Http/Controllers/UserOperationController.php:187
* @route '/fuzzy-operations/edit-operations/{userOperation}'
*/
updateForm.put = (args: { userOperation: number | { id: number } } | [userOperation: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: update.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PUT',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

update.form = updateForm

/**
* @see \App\Http\Controllers\UserOperationController::destroy
* @see app/Http/Controllers/UserOperationController.php:221
* @route '/fuzzy-operations/{projectId}/{userId}'
*/
export const destroy = (args: { projectId: string | number, userId: string | number } | [projectId: string | number, userId: string | number ], options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

destroy.definition = {
    methods: ["delete"],
    url: '/fuzzy-operations/{projectId}/{userId}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\UserOperationController::destroy
* @see app/Http/Controllers/UserOperationController.php:221
* @route '/fuzzy-operations/{projectId}/{userId}'
*/
destroy.url = (args: { projectId: string | number, userId: string | number } | [projectId: string | number, userId: string | number ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
            projectId: args[0],
            userId: args[1],
        }
    }

    args = applyUrlDefaults(args)

    const parsedArgs = {
        projectId: args.projectId,
        userId: args.userId,
    }

    return destroy.definition.url
            .replace('{projectId}', parsedArgs.projectId.toString())
            .replace('{userId}', parsedArgs.userId.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::destroy
* @see app/Http/Controllers/UserOperationController.php:221
* @route '/fuzzy-operations/{projectId}/{userId}'
*/
destroy.delete = (args: { projectId: string | number, userId: string | number } | [projectId: string | number, userId: string | number ], options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\UserOperationController::destroy
* @see app/Http/Controllers/UserOperationController.php:221
* @route '/fuzzy-operations/{projectId}/{userId}'
*/
const destroyForm = (args: { projectId: string | number, userId: string | number } | [projectId: string | number, userId: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\UserOperationController::destroy
* @see app/Http/Controllers/UserOperationController.php:221
* @route '/fuzzy-operations/{projectId}/{userId}'
*/
destroyForm.delete = (args: { projectId: string | number, userId: string | number } | [projectId: string | number, userId: string | number ], options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroy.form = destroyForm

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
export const finals = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: finals.url(options),
    method: 'get',
})

finals.definition = {
    methods: ["get","head"],
    url: '/fuzzy-operations/finals',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
finals.url = (options?: RouteQueryOptions) => {
    return finals.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
finals.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: finals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
finals.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: finals.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
const finalsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: finals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
finalsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: finals.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserOperationController::finals
* @see app/Http/Controllers/UserOperationController.php:248
* @route '/fuzzy-operations/finals'
*/
finalsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: finals.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

finals.form = finalsForm

const UserOperationController = { index, create, store, edit, update, destroy, finals }

export default UserOperationController