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

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

/**
* @see \App\Http\Controllers\InboxController::index
 * @see app/Http/Controllers/InboxController.php:31
 * @route '/inbox'
 */
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\InboxController::index
 * @see app/Http/Controllers/InboxController.php:31
 * @route '/inbox'
 */
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\InboxController::index
 * @see app/Http/Controllers/InboxController.php:31
 * @route '/inbox'
 */
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

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

            /**
* @see \App\Http\Controllers\InboxController::index
 * @see app/Http/Controllers/InboxController.php:31
 * @route '/inbox'
 */
        indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: index.url(options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\InboxController::index
 * @see app/Http/Controllers/InboxController.php:31
 * @route '/inbox'
 */
        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\InboxController::store
 * @see app/Http/Controllers/InboxController.php:67
 * @route '/inbox'
 */
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\InboxController::store
 * @see app/Http/Controllers/InboxController.php:67
 * @route '/inbox'
 */
store.url = (options?: RouteQueryOptions) => {
    return store.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\InboxController::store
 * @see app/Http/Controllers/InboxController.php:67
 * @route '/inbox'
 */
store.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\InboxController::store
 * @see app/Http/Controllers/InboxController.php:67
 * @route '/inbox'
 */
    const storeForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: store.url(options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\InboxController::store
 * @see app/Http/Controllers/InboxController.php:67
 * @route '/inbox'
 */
        storeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: store.url(options),
            method: 'post',
        })
    
    store.form = storeForm
/**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
export const show = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

show.definition = {
    methods: ["get","head"],
    url: '/inbox/{thread}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
show.url = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { thread: args }
    }

            if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
            args = { thread: args.id }
        }
    
    if (Array.isArray(args)) {
        args = {
                    thread: args[0],
                }
    }

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
show.get = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
show.head = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
    const showForm = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: show.url(args, options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
        showForm.get = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: show.url(args, options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\InboxController::show
 * @see app/Http/Controllers/InboxController.php:46
 * @route '/inbox/{thread}'
 */
        showForm.head = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: 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\InboxController::reply
 * @see app/Http/Controllers/InboxController.php:79
 * @route '/inbox/{thread}/messages'
 */
export const reply = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: reply.url(args, options),
    method: 'post',
})

reply.definition = {
    methods: ["post"],
    url: '/inbox/{thread}/messages',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\InboxController::reply
 * @see app/Http/Controllers/InboxController.php:79
 * @route '/inbox/{thread}/messages'
 */
reply.url = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { thread: args }
    }

            if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
            args = { thread: args.id }
        }
    
    if (Array.isArray(args)) {
        args = {
                    thread: args[0],
                }
    }

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InboxController::reply
 * @see app/Http/Controllers/InboxController.php:79
 * @route '/inbox/{thread}/messages'
 */
reply.post = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: reply.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\InboxController::reply
 * @see app/Http/Controllers/InboxController.php:79
 * @route '/inbox/{thread}/messages'
 */
    const replyForm = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: reply.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\InboxController::reply
 * @see app/Http/Controllers/InboxController.php:79
 * @route '/inbox/{thread}/messages'
 */
        replyForm.post = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: reply.url(args, options),
            method: 'post',
        })
    
    reply.form = replyForm
/**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
export const attachment = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: attachment.url(args, options),
    method: 'get',
})

attachment.definition = {
    methods: ["get","head"],
    url: '/inbox/{thread}/messages/{message}/attachment',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
attachment.url = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions) => {
    if (Array.isArray(args)) {
        args = {
                    thread: args[0],
                    message: args[1],
                }
    }

    args = applyUrlDefaults(args)

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

    return attachment.definition.url
            .replace('{thread}', parsedArgs.thread.toString())
            .replace('{message}', parsedArgs.message.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

/**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
attachment.get = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: attachment.url(args, options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
attachment.head = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: attachment.url(args, options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
    const attachmentForm = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: attachment.url(args, options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
        attachmentForm.get = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: attachment.url(args, options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\InboxController::attachment
 * @see app/Http/Controllers/InboxController.php:109
 * @route '/inbox/{thread}/messages/{message}/attachment'
 */
        attachmentForm.head = (args: { thread: number | { id: number }, message: number | { id: number } } | [thread: number | { id: number }, message: number | { id: number } ], options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: attachment.url(args, {
                        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                            _method: 'HEAD',
                            ...(options?.query ?? options?.mergeQuery ?? {}),
                        }
                    }),
            method: 'get',
        })
    
    attachment.form = attachmentForm
/**
* @see \App\Http\Controllers\InboxController::addParticipants
 * @see app/Http/Controllers/InboxController.php:132
 * @route '/inbox/{thread}/participants'
 */
export const addParticipants = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: addParticipants.url(args, options),
    method: 'post',
})

addParticipants.definition = {
    methods: ["post"],
    url: '/inbox/{thread}/participants',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\InboxController::addParticipants
 * @see app/Http/Controllers/InboxController.php:132
 * @route '/inbox/{thread}/participants'
 */
addParticipants.url = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { thread: args }
    }

            if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
            args = { thread: args.id }
        }
    
    if (Array.isArray(args)) {
        args = {
                    thread: args[0],
                }
    }

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\InboxController::addParticipants
 * @see app/Http/Controllers/InboxController.php:132
 * @route '/inbox/{thread}/participants'
 */
addParticipants.post = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: addParticipants.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\InboxController::addParticipants
 * @see app/Http/Controllers/InboxController.php:132
 * @route '/inbox/{thread}/participants'
 */
    const addParticipantsForm = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: addParticipants.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\InboxController::addParticipants
 * @see app/Http/Controllers/InboxController.php:132
 * @route '/inbox/{thread}/participants'
 */
        addParticipantsForm.post = (args: { thread: number | { id: number } } | [thread: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: addParticipants.url(args, options),
            method: 'post',
        })
    
    addParticipants.form = addParticipantsForm
const InboxController = { index, store, show, reply, attachment, addParticipants }

export default InboxController