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

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

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::index
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:28
* @route '/admin/integrations/wordpress'
*/
index.url = (options?: RouteQueryOptions) => {
    return index.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::index
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:28
* @route '/admin/integrations/wordpress'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::index
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:28
* @route '/admin/integrations/wordpress'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::index
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:28
* @route '/admin/integrations/wordpress'
*/
const indexForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::index
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:28
* @route '/admin/integrations/wordpress'
*/
indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::index
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:28
* @route '/admin/integrations/wordpress'
*/
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\Admin\Platform\WordPressDistributionController::build
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:36
* @route '/admin/integrations/wordpress/build'
*/
export const build = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: build.url(options),
    method: 'post',
})

build.definition = {
    methods: ["post"],
    url: '/admin/integrations/wordpress/build',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::build
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:36
* @route '/admin/integrations/wordpress/build'
*/
build.url = (options?: RouteQueryOptions) => {
    return build.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::build
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:36
* @route '/admin/integrations/wordpress/build'
*/
build.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: build.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::build
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:36
* @route '/admin/integrations/wordpress/build'
*/
const buildForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: build.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::build
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:36
* @route '/admin/integrations/wordpress/build'
*/
buildForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: build.url(options),
    method: 'post',
})

build.form = buildForm

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
export const download = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: download.url(args, options),
    method: 'get',
})

download.definition = {
    methods: ["get","head"],
    url: '/admin/integrations/wordpress/download/{version}',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
download.url = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { version: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        version: args.version,
    }

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

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
download.get = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: download.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
download.head = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: download.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
const downloadForm = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: download.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
downloadForm.get = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: download.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Admin\Platform\WordPressDistributionController::download
* @see app/Http/Controllers/Admin/Platform/WordPressDistributionController.php:47
* @route '/admin/integrations/wordpress/download/{version}'
*/
downloadForm.head = (args: { version: string | number } | [version: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: download.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

download.form = downloadForm

const wordpress = {
    index: Object.assign(index, index),
    build: Object.assign(build, build),
    download: Object.assign(download, download),
}

export default wordpress