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

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::index
 * @see app/Http/Controllers/CustomerAccountController.php:36
 * @route '/customer-accounts'
 */
index.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: index.url(options),
    method: 'get',
})
/**
* @see \App\Http\Controllers\CustomerAccountController::index
 * @see app/Http/Controllers/CustomerAccountController.php:36
 * @route '/customer-accounts'
 */
index.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: index.url(options),
    method: 'head',
})

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

            /**
* @see \App\Http\Controllers\CustomerAccountController::index
 * @see app/Http/Controllers/CustomerAccountController.php:36
 * @route '/customer-accounts'
 */
        indexForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
            action: index.url(options),
            method: 'get',
        })
            /**
* @see \App\Http\Controllers\CustomerAccountController::index
 * @see app/Http/Controllers/CustomerAccountController.php:36
 * @route '/customer-accounts'
 */
        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\CustomerAccountController::update
 * @see app/Http/Controllers/CustomerAccountController.php:92
 * @route '/customer-accounts/{customerAccount}'
 */
export const update = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

update.definition = {
    methods: ["put"],
    url: '/customer-accounts/{customerAccount}',
} satisfies RouteDefinition<["put"]>

/**
* @see \App\Http\Controllers\CustomerAccountController::update
 * @see app/Http/Controllers/CustomerAccountController.php:92
 * @route '/customer-accounts/{customerAccount}'
 */
update.url = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customerAccount: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::update
 * @see app/Http/Controllers/CustomerAccountController.php:92
 * @route '/customer-accounts/{customerAccount}'
 */
update.put = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'put'> => ({
    url: update.url(args, options),
    method: 'put',
})

    /**
* @see \App\Http\Controllers\CustomerAccountController::update
 * @see app/Http/Controllers/CustomerAccountController.php:92
 * @route '/customer-accounts/{customerAccount}'
 */
    const updateForm = (args: { customerAccount: number | { id: number } } | [customerAccount: 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\CustomerAccountController::update
 * @see app/Http/Controllers/CustomerAccountController.php:92
 * @route '/customer-accounts/{customerAccount}'
 */
        updateForm.put = (args: { customerAccount: number | { id: number } } | [customerAccount: 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\CustomerAccountController::assignCustomer
 * @see app/Http/Controllers/CustomerAccountController.php:149
 * @route '/customer-accounts/{customerAccount}/customer'
 */
export const assignCustomer = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: assignCustomer.url(args, options),
    method: 'post',
})

assignCustomer.definition = {
    methods: ["post"],
    url: '/customer-accounts/{customerAccount}/customer',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\CustomerAccountController::assignCustomer
 * @see app/Http/Controllers/CustomerAccountController.php:149
 * @route '/customer-accounts/{customerAccount}/customer'
 */
assignCustomer.url = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customerAccount: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::assignCustomer
 * @see app/Http/Controllers/CustomerAccountController.php:149
 * @route '/customer-accounts/{customerAccount}/customer'
 */
assignCustomer.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: assignCustomer.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\CustomerAccountController::assignCustomer
 * @see app/Http/Controllers/CustomerAccountController.php:149
 * @route '/customer-accounts/{customerAccount}/customer'
 */
    const assignCustomerForm = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: assignCustomer.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\CustomerAccountController::assignCustomer
 * @see app/Http/Controllers/CustomerAccountController.php:149
 * @route '/customer-accounts/{customerAccount}/customer'
 */
        assignCustomerForm.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: assignCustomer.url(args, options),
            method: 'post',
        })
    
    assignCustomer.form = assignCustomerForm
/**
* @see \App\Http\Controllers\CustomerAccountController::access
 * @see app/Http/Controllers/CustomerAccountController.php:180
 * @route '/customer-accounts/{customerAccount}/access'
 */
export const access = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: access.url(args, options),
    method: 'post',
})

access.definition = {
    methods: ["post"],
    url: '/customer-accounts/{customerAccount}/access',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\CustomerAccountController::access
 * @see app/Http/Controllers/CustomerAccountController.php:180
 * @route '/customer-accounts/{customerAccount}/access'
 */
access.url = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customerAccount: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::access
 * @see app/Http/Controllers/CustomerAccountController.php:180
 * @route '/customer-accounts/{customerAccount}/access'
 */
access.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: access.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\CustomerAccountController::access
 * @see app/Http/Controllers/CustomerAccountController.php:180
 * @route '/customer-accounts/{customerAccount}/access'
 */
    const accessForm = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: access.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\CustomerAccountController::access
 * @see app/Http/Controllers/CustomerAccountController.php:180
 * @route '/customer-accounts/{customerAccount}/access'
 */
        accessForm.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: access.url(args, options),
            method: 'post',
        })
    
    access.form = accessForm
/**
* @see \App\Http\Controllers\CustomerAccountController::sendPasswordReset
 * @see app/Http/Controllers/CustomerAccountController.php:208
 * @route '/customer-accounts/{customerAccount}/password-reset'
 */
export const sendPasswordReset = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sendPasswordReset.url(args, options),
    method: 'post',
})

sendPasswordReset.definition = {
    methods: ["post"],
    url: '/customer-accounts/{customerAccount}/password-reset',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\CustomerAccountController::sendPasswordReset
 * @see app/Http/Controllers/CustomerAccountController.php:208
 * @route '/customer-accounts/{customerAccount}/password-reset'
 */
sendPasswordReset.url = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customerAccount: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::sendPasswordReset
 * @see app/Http/Controllers/CustomerAccountController.php:208
 * @route '/customer-accounts/{customerAccount}/password-reset'
 */
sendPasswordReset.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sendPasswordReset.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\CustomerAccountController::sendPasswordReset
 * @see app/Http/Controllers/CustomerAccountController.php:208
 * @route '/customer-accounts/{customerAccount}/password-reset'
 */
    const sendPasswordResetForm = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: sendPasswordReset.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\CustomerAccountController::sendPasswordReset
 * @see app/Http/Controllers/CustomerAccountController.php:208
 * @route '/customer-accounts/{customerAccount}/password-reset'
 */
        sendPasswordResetForm.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: sendPasswordReset.url(args, options),
            method: 'post',
        })
    
    sendPasswordReset.form = sendPasswordResetForm
/**
* @see \App\Http\Controllers\CustomerAccountController::resendVerification
 * @see app/Http/Controllers/CustomerAccountController.php:234
 * @route '/customer-accounts/{customerAccount}/verification'
 */
export const resendVerification = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: resendVerification.url(args, options),
    method: 'post',
})

resendVerification.definition = {
    methods: ["post"],
    url: '/customer-accounts/{customerAccount}/verification',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\CustomerAccountController::resendVerification
 * @see app/Http/Controllers/CustomerAccountController.php:234
 * @route '/customer-accounts/{customerAccount}/verification'
 */
resendVerification.url = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customerAccount: args }
    }

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::resendVerification
 * @see app/Http/Controllers/CustomerAccountController.php:234
 * @route '/customer-accounts/{customerAccount}/verification'
 */
resendVerification.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: resendVerification.url(args, options),
    method: 'post',
})

    /**
* @see \App\Http\Controllers\CustomerAccountController::resendVerification
 * @see app/Http/Controllers/CustomerAccountController.php:234
 * @route '/customer-accounts/{customerAccount}/verification'
 */
    const resendVerificationForm = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
        action: resendVerification.url(args, options),
        method: 'post',
    })

            /**
* @see \App\Http\Controllers\CustomerAccountController::resendVerification
 * @see app/Http/Controllers/CustomerAccountController.php:234
 * @route '/customer-accounts/{customerAccount}/verification'
 */
        resendVerificationForm.post = (args: { customerAccount: number | { id: number } } | [customerAccount: number | { id: number } ] | number | { id: number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
            action: resendVerification.url(args, options),
            method: 'post',
        })
    
    resendVerification.form = resendVerificationForm
const CustomerAccountController = { index, update, assignCustomer, access, sendPasswordReset, resendVerification }

export default CustomerAccountController