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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::customer
 * @see app/Http/Controllers/CustomerAccountController.php:149
 * @route '/customer-accounts/{customerAccount}/customer'
 */
customer.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 customer.definition.url
            .replace('{customerAccount}', parsedArgs.customerAccount.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

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

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

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::password
 * @see app/Http/Controllers/CustomerAccountController.php:208
 * @route '/customer-accounts/{customerAccount}/password-reset'
 */
password.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 password.definition.url
            .replace('{customerAccount}', parsedArgs.customerAccount.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

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

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

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

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

/**
* @see \App\Http\Controllers\CustomerAccountController::verification
 * @see app/Http/Controllers/CustomerAccountController.php:234
 * @route '/customer-accounts/{customerAccount}/verification'
 */
verification.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 verification.definition.url
            .replace('{customerAccount}', parsedArgs.customerAccount.toString())
            .replace(/\/+$/, '') + queryParams(options)
}

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

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

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

export default customerAccounts