import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition } from './../../../wayfinder'
/**
* @see \App\Http\Controllers\Api\V1\DispatchController::generate
* @see app/Http/Controllers/Api/V1/DispatchController.php:360
* @route '/dispatch/routes/generate'
*/
export const generate = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: generate.url(options),
    method: 'post',
})

generate.definition = {
    methods: ["post"],
    url: '/dispatch/routes/generate',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\DispatchController::generate
* @see app/Http/Controllers/Api/V1/DispatchController.php:360
* @route '/dispatch/routes/generate'
*/
generate.url = (options?: RouteQueryOptions) => {
    return generate.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\DispatchController::generate
* @see app/Http/Controllers/Api/V1/DispatchController.php:360
* @route '/dispatch/routes/generate'
*/
generate.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: generate.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\DispatchController::generate
* @see app/Http/Controllers/Api/V1/DispatchController.php:360
* @route '/dispatch/routes/generate'
*/
const generateForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: generate.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\DispatchController::generate
* @see app/Http/Controllers/Api/V1/DispatchController.php:360
* @route '/dispatch/routes/generate'
*/
generateForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: generate.url(options),
    method: 'post',
})

generate.form = generateForm

const routes = {
    generate: Object.assign(generate, generate),
}

export default routes