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

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

/**
* @see \App\Http\Controllers\ProductBacklogController::index
* @see app/Http/Controllers/ProductBacklogController.php:28
* @route '/product-backlogs'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\ProductBacklogController::index
* @see app/Http/Controllers/ProductBacklogController.php:28
* @route '/product-backlogs'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::index
* @see app/Http/Controllers/ProductBacklogController.php:28
* @route '/product-backlogs'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

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

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

/**
* @see \App\Http\Controllers\ProductBacklogController::index
* @see app/Http/Controllers/ProductBacklogController.php:28
* @route '/product-backlogs'
*/
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\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
export const create = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

create.definition = {
    methods: ["get","head"],
    url: '/product-backlogs/fus-create',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
create.url = (options?: RouteQueryOptions) => {
    return create.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
create.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
create.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: create.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
const createForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
createForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: create.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::create
* @see app/Http/Controllers/ProductBacklogController.php:110
* @route '/product-backlogs/fus-create'
*/
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\ProductBacklogController::store
* @see app/Http/Controllers/ProductBacklogController.php:132
* @route '/product-backlogs/fus-create'
*/
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

store.definition = {
    methods: ["post"],
    url: '/product-backlogs/fus-create',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\ProductBacklogController::store
* @see app/Http/Controllers/ProductBacklogController.php:132
* @route '/product-backlogs/fus-create'
*/
store.url = (options?: RouteQueryOptions) => {
    return store.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\ProductBacklogController::store
* @see app/Http/Controllers/ProductBacklogController.php:132
* @route '/product-backlogs/fus-create'
*/
store.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::store
* @see app/Http/Controllers/ProductBacklogController.php:132
* @route '/product-backlogs/fus-create'
*/
const storeForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::store
* @see app/Http/Controllers/ProductBacklogController.php:132
* @route '/product-backlogs/fus-create'
*/
storeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: store.url(options),
    method: 'post',
})

store.form = storeForm

/**
* @see \App\Http\Controllers\ProductBacklogController::destroy
* @see app/Http/Controllers/ProductBacklogController.php:202
* @route '/product-backlogs/{id}'
*/
export const destroy = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

destroy.definition = {
    methods: ["delete"],
    url: '/product-backlogs/{id}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\ProductBacklogController::destroy
* @see app/Http/Controllers/ProductBacklogController.php:202
* @route '/product-backlogs/{id}'
*/
destroy.url = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { id: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        id: args.id,
    }

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

/**
* @see \App\Http\Controllers\ProductBacklogController::destroy
* @see app/Http/Controllers/ProductBacklogController.php:202
* @route '/product-backlogs/{id}'
*/
destroy.delete = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::destroy
* @see app/Http/Controllers/ProductBacklogController.php:202
* @route '/product-backlogs/{id}'
*/
const destroyForm = (args: { id: string | number } | [id: string | number ] | 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\ProductBacklogController::destroy
* @see app/Http/Controllers/ProductBacklogController.php:202
* @route '/product-backlogs/{id}'
*/
destroyForm.delete = (args: { id: string | number } | [id: string | number ] | 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\ProductBacklogController::update
* @see app/Http/Controllers/ProductBacklogController.php:182
* @route '/product-backlogs/{id}'
*/
export const update = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

update.definition = {
    methods: ["put"],
    url: '/product-backlogs/{id}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\ProductBacklogController::update
* @see app/Http/Controllers/ProductBacklogController.php:182
* @route '/product-backlogs/{id}'
*/
update.url = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { id: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        id: args.id,
    }

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

/**
* @see \App\Http\Controllers\ProductBacklogController::update
* @see app/Http/Controllers/ProductBacklogController.php:182
* @route '/product-backlogs/{id}'
*/
update.put = (args: { id: string | number } | [id: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::update
* @see app/Http/Controllers/ProductBacklogController.php:182
* @route '/product-backlogs/{id}'
*/
const updateForm = (args: { id: string | number } | [id: string | number ] | string | 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\ProductBacklogController::update
* @see app/Http/Controllers/ProductBacklogController.php:182
* @route '/product-backlogs/{id}'
*/
updateForm.put = (args: { id: string | number } | [id: string | number ] | string | 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\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
export const nfr = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: nfr.url(options),
    method: 'get',
})

nfr.definition = {
    methods: ["get","head"],
    url: '/product-backlogs/non-functional-requirements',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
nfr.url = (options?: RouteQueryOptions) => {
    return nfr.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
nfr.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: nfr.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
nfr.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: nfr.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
const nfrForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: nfr.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
nfrForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: nfr.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::nfr
* @see app/Http/Controllers/ProductBacklogController.php:55
* @route '/product-backlogs/non-functional-requirements'
*/
nfrForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: nfr.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

nfr.form = nfrForm

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
export const sprintBacklogs = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: sprintBacklogs.url(options),
    method: 'get',
})

sprintBacklogs.definition = {
    methods: ["get","head"],
    url: '/product-backlogs/sprint-backlogs',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
sprintBacklogs.url = (options?: RouteQueryOptions) => {
    return sprintBacklogs.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
sprintBacklogs.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: sprintBacklogs.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
sprintBacklogs.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: sprintBacklogs.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
const sprintBacklogsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: sprintBacklogs.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
sprintBacklogsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: sprintBacklogs.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\ProductBacklogController::sprintBacklogs
* @see app/Http/Controllers/ProductBacklogController.php:82
* @route '/product-backlogs/sprint-backlogs'
*/
sprintBacklogsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: sprintBacklogs.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

sprintBacklogs.form = sprintBacklogsForm

const ProductBacklogController = { index, create, store, destroy, update, nfr, sprintBacklogs }

export default ProductBacklogController