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

index.definition = {
    methods: ["get","head"],
    url: '/registered-users/update-requests',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\RegisteredUsersController::index
* @see app/Http/Controllers/RegisteredUsersController.php:177
* @route '/registered-users/update-requests'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\RegisteredUsersController::index
* @see app/Http/Controllers/RegisteredUsersController.php:177
* @route '/registered-users/update-requests'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::index
* @see app/Http/Controllers/RegisteredUsersController.php:177
* @route '/registered-users/update-requests'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::index
* @see app/Http/Controllers/RegisteredUsersController.php:177
* @route '/registered-users/update-requests'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::index
* @see app/Http/Controllers/RegisteredUsersController.php:177
* @route '/registered-users/update-requests'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::index
* @see app/Http/Controllers/RegisteredUsersController.php:177
* @route '/registered-users/update-requests'
*/
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\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
export const show = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

show.definition = {
    methods: ["get","head"],
    url: '/registered-users/update-requests/{updateRequest}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
show.url = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { updateRequest: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
show.get = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
show.head = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
const showForm = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
showForm.get = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::show
* @see app/Http/Controllers/RegisteredUsersController.php:220
* @route '/registered-users/update-requests/{updateRequest}'
*/
showForm.head = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: show.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

show.form = showForm

/**
* @see \App\Http\Controllers\RegisteredUsersController::approve
* @see app/Http/Controllers/RegisteredUsersController.php:291
* @route '/registered-users/update-requests/{updateRequest}/approve'
*/
export const approve = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: approve.url(args, options),
    method: 'post',
})

approve.definition = {
    methods: ["post"],
    url: '/registered-users/update-requests/{updateRequest}/approve',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\RegisteredUsersController::approve
* @see app/Http/Controllers/RegisteredUsersController.php:291
* @route '/registered-users/update-requests/{updateRequest}/approve'
*/
approve.url = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { updateRequest: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\RegisteredUsersController::approve
* @see app/Http/Controllers/RegisteredUsersController.php:291
* @route '/registered-users/update-requests/{updateRequest}/approve'
*/
approve.post = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: approve.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::approve
* @see app/Http/Controllers/RegisteredUsersController.php:291
* @route '/registered-users/update-requests/{updateRequest}/approve'
*/
const approveForm = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: approve.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::approve
* @see app/Http/Controllers/RegisteredUsersController.php:291
* @route '/registered-users/update-requests/{updateRequest}/approve'
*/
approveForm.post = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: approve.url(args, options),
    method: 'post',
})

approve.form = approveForm

/**
* @see \App\Http\Controllers\RegisteredUsersController::reject
* @see app/Http/Controllers/RegisteredUsersController.php:347
* @route '/registered-users/update-requests/{updateRequest}/reject'
*/
export const reject = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: reject.url(args, options),
    method: 'post',
})

reject.definition = {
    methods: ["post"],
    url: '/registered-users/update-requests/{updateRequest}/reject',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\RegisteredUsersController::reject
* @see app/Http/Controllers/RegisteredUsersController.php:347
* @route '/registered-users/update-requests/{updateRequest}/reject'
*/
reject.url = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { updateRequest: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\RegisteredUsersController::reject
* @see app/Http/Controllers/RegisteredUsersController.php:347
* @route '/registered-users/update-requests/{updateRequest}/reject'
*/
reject.post = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: reject.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::reject
* @see app/Http/Controllers/RegisteredUsersController.php:347
* @route '/registered-users/update-requests/{updateRequest}/reject'
*/
const rejectForm = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: reject.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\RegisteredUsersController::reject
* @see app/Http/Controllers/RegisteredUsersController.php:347
* @route '/registered-users/update-requests/{updateRequest}/reject'
*/
rejectForm.post = (args: { updateRequest: string | number | { id: string | number } } | [updateRequest: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: reject.url(args, options),
    method: 'post',
})

reject.form = rejectForm

const updateRequests = {
    index: Object.assign(index, index),
    show: Object.assign(show, show),
    approve: Object.assign(approve, approve),
    reject: Object.assign(reject, reject),
}

export default updateRequests