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

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

/**
* @see \App\Http\Controllers\Customer\TicketController::index
 * @see app/Http/Controllers/Customer/TicketController.php:34
 * @route '/ticket/tickets'
 */
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Customer\TicketController::index
 * @see app/Http/Controllers/Customer/TicketController.php:34
 * @route '/ticket/tickets'
 */
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\Customer\TicketController::index
 * @see app/Http/Controllers/Customer/TicketController.php:34
 * @route '/ticket/tickets'
 */
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

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

            /**
* @see \App\Http\Controllers\Customer\TicketController::index
 * @see app/Http/Controllers/Customer/TicketController.php:34
 * @route '/ticket/tickets'
 */
        indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: index.url(options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\Customer\TicketController::index
 * @see app/Http/Controllers/Customer/TicketController.php:34
 * @route '/ticket/tickets'
 */
        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\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
export const create = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})

create.definition = {
    methods: ["get","head"],
    url: '/ticket/tickets/new',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
create.url = (options?: RouteQueryOptions) => {
    return create.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
create.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: create.url(options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
create.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: create.url(options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
    const createForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: create.url(options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
        createForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: create.url(options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\Customer\TicketController::create
 * @see app/Http/Controllers/Customer/TicketController.php:55
 * @route '/ticket/tickets/new'
 */
        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\Customer\TicketController::store
 * @see app/Http/Controllers/Customer/TicketController.php:99
 * @route '/ticket/tickets'
 */
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\Customer\TicketController::store
 * @see app/Http/Controllers/Customer/TicketController.php:99
 * @route '/ticket/tickets'
 */
store.url = (options?: RouteQueryOptions) => {
    return store.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Customer\TicketController::store
 * @see app/Http/Controllers/Customer/TicketController.php:99
 * @route '/ticket/tickets'
 */
store.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

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

            /**
* @see \App\Http\Controllers\Customer\TicketController::store
 * @see app/Http/Controllers/Customer/TicketController.php:99
 * @route '/ticket/tickets'
 */
        storeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: store.url(options),
            method: 'post',
        })
    
    store.form = storeForm
/**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
export const show = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
show.url = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { ticket: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
                        ticket: args.ticket,
                }

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

/**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
show.get = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
show.head = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
    const showForm = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: show.url(args, options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
        showForm.get = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: show.url(args, options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\Customer\TicketController::show
 * @see app/Http/Controllers/Customer/TicketController.php:144
 * @route '/ticket/tickets/{ticket}'
 */
        showForm.head = (args: { ticket: string | number } | [ticket: string | number ] | 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\Customer\TicketController::reply
 * @see app/Http/Controllers/Customer/TicketController.php:154
 * @route '/ticket/tickets/{ticket}/reply'
 */
export const reply = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: reply.url(args, options),
    method: 'post',
})

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

/**
* @see \App\Http\Controllers\Customer\TicketController::reply
 * @see app/Http/Controllers/Customer/TicketController.php:154
 * @route '/ticket/tickets/{ticket}/reply'
 */
reply.url = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { ticket: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
                        ticket: args.ticket,
                }

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

/**
* @see \App\Http\Controllers\Customer\TicketController::reply
 * @see app/Http/Controllers/Customer/TicketController.php:154
 * @route '/ticket/tickets/{ticket}/reply'
 */
reply.post = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: reply.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\Customer\TicketController::reply
 * @see app/Http/Controllers/Customer/TicketController.php:154
 * @route '/ticket/tickets/{ticket}/reply'
 */
    const replyForm = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: reply.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\Customer\TicketController::reply
 * @see app/Http/Controllers/Customer/TicketController.php:154
 * @route '/ticket/tickets/{ticket}/reply'
 */
        replyForm.post = (args: { ticket: string | number } | [ticket: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: reply.url(args, options),
            method: 'post',
        })
    
    reply.form = replyForm
const tickets = {
    index: Object.assign(index, index),
create: Object.assign(create, create),
store: Object.assign(store, store),
show: Object.assign(show, show),
reply: Object.assign(reply, reply),
attachments: Object.assign(attachments, attachments),
}

export default tickets