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

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

/**
* @see \App\Http\Controllers\Api\PartnerShowController::index
 * @see app/Http/Controllers/Api/PartnerShowController.php:15
 * @route '/api/v1/shows'
 */
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\PartnerShowController::index
 * @see app/Http/Controllers/Api/PartnerShowController.php:15
 * @route '/api/v1/shows'
 */
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\Api\PartnerShowController::index
 * @see app/Http/Controllers/Api/PartnerShowController.php:15
 * @route '/api/v1/shows'
 */
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\Api\PartnerShowController::index
 * @see app/Http/Controllers/Api/PartnerShowController.php:15
 * @route '/api/v1/shows'
 */
    const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: index.url(options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\Api\PartnerShowController::index
 * @see app/Http/Controllers/Api/PartnerShowController.php:15
 * @route '/api/v1/shows'
 */
        indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: index.url(options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\Api\PartnerShowController::index
 * @see app/Http/Controllers/Api/PartnerShowController.php:15
 * @route '/api/v1/shows'
 */
        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\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
export const show = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
show.url = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { show: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
show.get = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: show.url(args, options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
show.head = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: show.url(args, options),
    method: 'head',
})

    /**
* @see \App\Http\Controllers\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
    const showForm = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
        action: show.url(args, options),
        method: 'get',
    })

            /**
* @see \App\Http\Controllers\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
        showForm.get = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: show.url(args, options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\Api\PartnerShowController::show
 * @see app/Http/Controllers/Api/PartnerShowController.php:72
 * @route '/api/v1/shows/{show}'
 */
        showForm.head = (args: { show: number | { id: number } } | [show: 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\Api\PartnerShowController::update
 * @see app/Http/Controllers/Api/PartnerShowController.php:99
 * @route '/api/v1/shows/{show}'
 */
export const update = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

update.definition = {
    methods: ["put"],
    url: '/api/v1/shows/{show}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\Api\PartnerShowController::update
 * @see app/Http/Controllers/Api/PartnerShowController.php:99
 * @route '/api/v1/shows/{show}'
 */
update.url = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { show: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\PartnerShowController::update
 * @see app/Http/Controllers/Api/PartnerShowController.php:99
 * @route '/api/v1/shows/{show}'
 */
update.put = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

    /**
* @see \App\Http\Controllers\Api\PartnerShowController::update
 * @see app/Http/Controllers/Api/PartnerShowController.php:99
 * @route '/api/v1/shows/{show}'
 */
    const updateForm = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: 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\Api\PartnerShowController::update
 * @see app/Http/Controllers/Api/PartnerShowController.php:99
 * @route '/api/v1/shows/{show}'
 */
        updateForm.put = (args: { show: number | { id: number } } | [show: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: update.url(args, {
                        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
                            _method: 'PUT',
                            ...(options?.query ?? options?.mergeQuery ?? {}),
                        }
                    }),
            method: 'post',
        })
    
    update.form = updateForm
const PartnerShowController = { index, show, update }

export default PartnerShowController