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

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

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

/**
* @see \App\Http\Controllers\UserWalletController::index
* @see app/Http/Controllers/UserWalletController.php:36
* @route '/balances/billeteras'
*/
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\UserWalletController::index
* @see app/Http/Controllers/UserWalletController.php:36
* @route '/balances/billeteras'
*/
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

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

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

/**
* @see \App\Http\Controllers\UserWalletController::index
* @see app/Http/Controllers/UserWalletController.php:36
* @route '/balances/billeteras'
*/
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\UserWalletController::store
* @see app/Http/Controllers/UserWalletController.php:54
* @route '/balances/billeteras'
*/
export const store = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: store.url(options),
    method: 'post',
})

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

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

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

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

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

store.form = storeForm

/**
* @see \App\Http\Controllers\UserWalletController::update
* @see app/Http/Controllers/UserWalletController.php:85
* @route '/balances/billeteras/{user_wallet}'
*/
export const update = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

update.definition = {
    methods: ["put"],
    url: '/balances/billeteras/{user_wallet}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\UserWalletController::update
* @see app/Http/Controllers/UserWalletController.php:85
* @route '/balances/billeteras/{user_wallet}'
*/
update.url = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user_wallet: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user_wallet: args.id }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\UserWalletController::update
* @see app/Http/Controllers/UserWalletController.php:85
* @route '/balances/billeteras/{user_wallet}'
*/
update.put = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

/**
* @see \App\Http\Controllers\UserWalletController::update
* @see app/Http/Controllers/UserWalletController.php:85
* @route '/balances/billeteras/{user_wallet}'
*/
const updateForm = (args: { user_wallet: number | { id: number } } | [user_wallet: 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\UserWalletController::update
* @see app/Http/Controllers/UserWalletController.php:85
* @route '/balances/billeteras/{user_wallet}'
*/
updateForm.put = (args: { user_wallet: number | { id: number } } | [user_wallet: 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

/**
* @see \App\Http\Controllers\UserWalletController::destroy
* @see app/Http/Controllers/UserWalletController.php:114
* @route '/balances/billeteras/{user_wallet}'
*/
export const destroy = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

destroy.definition = {
    methods: ["delete"],
    url: '/balances/billeteras/{user_wallet}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\UserWalletController::destroy
* @see app/Http/Controllers/UserWalletController.php:114
* @route '/balances/billeteras/{user_wallet}'
*/
destroy.url = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { user_wallet: args }
    }

    if (typeof args === 'object' && !Array.isArray(args) && 'id' in args) {
        args = { user_wallet: args.id }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\UserWalletController::destroy
* @see app/Http/Controllers/UserWalletController.php:114
* @route '/balances/billeteras/{user_wallet}'
*/
destroy.delete = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroy.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\UserWalletController::destroy
* @see app/Http/Controllers/UserWalletController.php:114
* @route '/balances/billeteras/{user_wallet}'
*/
const destroyForm = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: 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\UserWalletController::destroy
* @see app/Http/Controllers/UserWalletController.php:114
* @route '/balances/billeteras/{user_wallet}'
*/
destroyForm.delete = (args: { user_wallet: number | { id: number } } | [user_wallet: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroy.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroy.form = destroyForm

const UserWalletController = { index, store, update, destroy }

export default UserWalletController