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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::customers
* @see app/Http/Controllers/Api/V1/CrmController.php:12
* @route '/api/v1/customers'
*/
customers.url = (options?: RouteQueryOptions) => {
    return customers.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::customers
* @see app/Http/Controllers/Api/V1/CrmController.php:12
* @route '/api/v1/customers'
*/
customers.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: customers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::customers
* @see app/Http/Controllers/Api/V1/CrmController.php:12
* @route '/api/v1/customers'
*/
customers.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: customers.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::customers
* @see app/Http/Controllers/Api/V1/CrmController.php:12
* @route '/api/v1/customers'
*/
const customersForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: customers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::customers
* @see app/Http/Controllers/Api/V1/CrmController.php:12
* @route '/api/v1/customers'
*/
customersForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: customers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::customers
* @see app/Http/Controllers/Api/V1/CrmController.php:12
* @route '/api/v1/customers'
*/
customersForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: customers.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

customers.form = customersForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:29
* @route '/api/v1/customers'
*/
export const storeCustomer = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeCustomer.url(options),
    method: 'post',
})

storeCustomer.definition = {
    methods: ["post"],
    url: '/api/v1/customers',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:29
* @route '/api/v1/customers'
*/
storeCustomer.url = (options?: RouteQueryOptions) => {
    return storeCustomer.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:29
* @route '/api/v1/customers'
*/
storeCustomer.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeCustomer.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:29
* @route '/api/v1/customers'
*/
const storeCustomerForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeCustomer.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:29
* @route '/api/v1/customers'
*/
storeCustomerForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeCustomer.url(options),
    method: 'post',
})

storeCustomer.form = storeCustomerForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
export const showCustomer = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showCustomer.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
showCustomer.url = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customer: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
showCustomer.get = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showCustomer.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
showCustomer.head = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: showCustomer.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
const showCustomerForm = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showCustomer.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
showCustomerForm.get = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showCustomer.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:22
* @route '/api/v1/customers/{customer}'
*/
showCustomerForm.head = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showCustomer.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

showCustomer.form = showCustomerForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:51
* @route '/api/v1/customers/{customer}'
*/
export const updateCustomer = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateCustomer.url(args, options),
    method: 'patch',
})

updateCustomer.definition = {
    methods: ["patch"],
    url: '/api/v1/customers/{customer}',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:51
* @route '/api/v1/customers/{customer}'
*/
updateCustomer.url = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customer: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:51
* @route '/api/v1/customers/{customer}'
*/
updateCustomer.patch = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateCustomer.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:51
* @route '/api/v1/customers/{customer}'
*/
const updateCustomerForm = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateCustomer.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:51
* @route '/api/v1/customers/{customer}'
*/
updateCustomerForm.patch = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateCustomer.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

updateCustomer.form = updateCustomerForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:68
* @route '/api/v1/customers/{customer}'
*/
export const destroyCustomer = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyCustomer.url(args, options),
    method: 'delete',
})

destroyCustomer.definition = {
    methods: ["delete"],
    url: '/api/v1/customers/{customer}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:68
* @route '/api/v1/customers/{customer}'
*/
destroyCustomer.url = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customer: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:68
* @route '/api/v1/customers/{customer}'
*/
destroyCustomer.delete = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyCustomer.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:68
* @route '/api/v1/customers/{customer}'
*/
const destroyCustomerForm = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyCustomer.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:68
* @route '/api/v1/customers/{customer}'
*/
destroyCustomerForm.delete = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyCustomer.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroyCustomer.form = destroyCustomerForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
export const searchCustomers = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: searchCustomers.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
searchCustomers.url = (options?: RouteQueryOptions) => {
    return searchCustomers.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
searchCustomers.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: searchCustomers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
searchCustomers.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: searchCustomers.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
const searchCustomersForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchCustomers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
searchCustomersForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchCustomers.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchCustomers
* @see app/Http/Controllers/Api/V1/CrmController.php:76
* @route '/api/v1/customers/search'
*/
searchCustomersForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchCustomers.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

searchCustomers.form = searchCustomersForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:89
* @route '/api/v1/customers/quick-create'
*/
export const quickCreateCustomer = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: quickCreateCustomer.url(options),
    method: 'post',
})

quickCreateCustomer.definition = {
    methods: ["post"],
    url: '/api/v1/customers/quick-create',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:89
* @route '/api/v1/customers/quick-create'
*/
quickCreateCustomer.url = (options?: RouteQueryOptions) => {
    return quickCreateCustomer.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:89
* @route '/api/v1/customers/quick-create'
*/
quickCreateCustomer.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: quickCreateCustomer.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:89
* @route '/api/v1/customers/quick-create'
*/
const quickCreateCustomerForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: quickCreateCustomer.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateCustomer
* @see app/Http/Controllers/Api/V1/CrmController.php:89
* @route '/api/v1/customers/quick-create'
*/
quickCreateCustomerForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: quickCreateCustomer.url(options),
    method: 'post',
})

quickCreateCustomer.form = quickCreateCustomerForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerEmail
* @see app/Http/Controllers/Api/V1/CrmController.php:94
* @route '/api/v1/customers/{customer}/send-email'
*/
export const sendCustomerEmail = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sendCustomerEmail.url(args, options),
    method: 'post',
})

sendCustomerEmail.definition = {
    methods: ["post"],
    url: '/api/v1/customers/{customer}/send-email',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerEmail
* @see app/Http/Controllers/Api/V1/CrmController.php:94
* @route '/api/v1/customers/{customer}/send-email'
*/
sendCustomerEmail.url = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customer: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerEmail
* @see app/Http/Controllers/Api/V1/CrmController.php:94
* @route '/api/v1/customers/{customer}/send-email'
*/
sendCustomerEmail.post = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sendCustomerEmail.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerEmail
* @see app/Http/Controllers/Api/V1/CrmController.php:94
* @route '/api/v1/customers/{customer}/send-email'
*/
const sendCustomerEmailForm = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sendCustomerEmail.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerEmail
* @see app/Http/Controllers/Api/V1/CrmController.php:94
* @route '/api/v1/customers/{customer}/send-email'
*/
sendCustomerEmailForm.post = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sendCustomerEmail.url(args, options),
    method: 'post',
})

sendCustomerEmail.form = sendCustomerEmailForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerSms
* @see app/Http/Controllers/Api/V1/CrmController.php:105
* @route '/api/v1/customers/{customer}/send-sms'
*/
export const sendCustomerSms = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sendCustomerSms.url(args, options),
    method: 'post',
})

sendCustomerSms.definition = {
    methods: ["post"],
    url: '/api/v1/customers/{customer}/send-sms',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerSms
* @see app/Http/Controllers/Api/V1/CrmController.php:105
* @route '/api/v1/customers/{customer}/send-sms'
*/
sendCustomerSms.url = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { customer: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerSms
* @see app/Http/Controllers/Api/V1/CrmController.php:105
* @route '/api/v1/customers/{customer}/send-sms'
*/
sendCustomerSms.post = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: sendCustomerSms.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerSms
* @see app/Http/Controllers/Api/V1/CrmController.php:105
* @route '/api/v1/customers/{customer}/send-sms'
*/
const sendCustomerSmsForm = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sendCustomerSms.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::sendCustomerSms
* @see app/Http/Controllers/Api/V1/CrmController.php:105
* @route '/api/v1/customers/{customer}/send-sms'
*/
sendCustomerSmsForm.post = (args: { customer: string | number | { id: string | number } } | [customer: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: sendCustomerSms.url(args, options),
    method: 'post',
})

sendCustomerSms.form = sendCustomerSmsForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
export const contacts = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: contacts.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
contacts.url = (options?: RouteQueryOptions) => {
    return contacts.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
contacts.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: contacts.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
contacts.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: contacts.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
const contactsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: contacts.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
contactsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: contacts.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::contacts
* @see app/Http/Controllers/Api/V1/CrmController.php:115
* @route '/api/v1/contacts'
*/
contactsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: contacts.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

contacts.form = contactsForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeContact
* @see app/Http/Controllers/Api/V1/CrmController.php:133
* @route '/api/v1/contacts'
*/
export const storeContact = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeContact.url(options),
    method: 'post',
})

storeContact.definition = {
    methods: ["post"],
    url: '/api/v1/contacts',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeContact
* @see app/Http/Controllers/Api/V1/CrmController.php:133
* @route '/api/v1/contacts'
*/
storeContact.url = (options?: RouteQueryOptions) => {
    return storeContact.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeContact
* @see app/Http/Controllers/Api/V1/CrmController.php:133
* @route '/api/v1/contacts'
*/
storeContact.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: storeContact.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeContact
* @see app/Http/Controllers/Api/V1/CrmController.php:133
* @route '/api/v1/contacts'
*/
const storeContactForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeContact.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::storeContact
* @see app/Http/Controllers/Api/V1/CrmController.php:133
* @route '/api/v1/contacts'
*/
storeContactForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: storeContact.url(options),
    method: 'post',
})

storeContact.form = storeContactForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
export const showContact = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showContact.url(args, options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
showContact.url = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { contact: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
showContact.get = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: showContact.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
showContact.head = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: showContact.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
const showContactForm = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showContact.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
showContactForm.get = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showContact.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::showContact
* @see app/Http/Controllers/Api/V1/CrmController.php:126
* @route '/api/v1/contacts/{contact}'
*/
showContactForm.head = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: showContact.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

showContact.form = showContactForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:154
* @route '/api/v1/contacts/{contact}'
*/
export const updateContact = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateContact.url(args, options),
    method: 'patch',
})

updateContact.definition = {
    methods: ["patch"],
    url: '/api/v1/contacts/{contact}',
} satisfies RouteDefinition<["patch"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:154
* @route '/api/v1/contacts/{contact}'
*/
updateContact.url = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { contact: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:154
* @route '/api/v1/contacts/{contact}'
*/
updateContact.patch = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'patch'> => ({
    url: updateContact.url(args, options),
    method: 'patch',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:154
* @route '/api/v1/contacts/{contact}'
*/
const updateContactForm = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateContact.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::updateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:154
* @route '/api/v1/contacts/{contact}'
*/
updateContactForm.patch = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: updateContact.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'PATCH',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

updateContact.form = updateContactForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyContact
* @see app/Http/Controllers/Api/V1/CrmController.php:172
* @route '/api/v1/contacts/{contact}'
*/
export const destroyContact = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyContact.url(args, options),
    method: 'delete',
})

destroyContact.definition = {
    methods: ["delete"],
    url: '/api/v1/contacts/{contact}',
} satisfies RouteDefinition<["delete"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyContact
* @see app/Http/Controllers/Api/V1/CrmController.php:172
* @route '/api/v1/contacts/{contact}'
*/
destroyContact.url = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { contact: args }
    }

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

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

    args = applyUrlDefaults(args)

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

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyContact
* @see app/Http/Controllers/Api/V1/CrmController.php:172
* @route '/api/v1/contacts/{contact}'
*/
destroyContact.delete = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteDefinition<'delete'> => ({
    url: destroyContact.url(args, options),
    method: 'delete',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyContact
* @see app/Http/Controllers/Api/V1/CrmController.php:172
* @route '/api/v1/contacts/{contact}'
*/
const destroyContactForm = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyContact.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::destroyContact
* @see app/Http/Controllers/Api/V1/CrmController.php:172
* @route '/api/v1/contacts/{contact}'
*/
destroyContactForm.delete = (args: { contact: string | number | { id: string | number } } | [contact: string | number | { id: string | number } ] | string | number | { id: string | number }, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: destroyContact.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'DELETE',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'post',
})

destroyContact.form = destroyContactForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
export const searchContacts = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: searchContacts.url(options),
    method: 'get',
})

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

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
searchContacts.url = (options?: RouteQueryOptions) => {
    return searchContacts.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
searchContacts.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: searchContacts.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
searchContacts.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: searchContacts.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
const searchContactsForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchContacts.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
searchContactsForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchContacts.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::searchContacts
* @see app/Http/Controllers/Api/V1/CrmController.php:180
* @route '/api/v1/contacts/search'
*/
searchContactsForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: searchContacts.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

searchContacts.form = searchContactsForm

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:193
* @route '/api/v1/contacts/quick-create'
*/
export const quickCreateContact = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: quickCreateContact.url(options),
    method: 'post',
})

quickCreateContact.definition = {
    methods: ["post"],
    url: '/api/v1/contacts/quick-create',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:193
* @route '/api/v1/contacts/quick-create'
*/
quickCreateContact.url = (options?: RouteQueryOptions) => {
    return quickCreateContact.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:193
* @route '/api/v1/contacts/quick-create'
*/
quickCreateContact.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: quickCreateContact.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:193
* @route '/api/v1/contacts/quick-create'
*/
const quickCreateContactForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: quickCreateContact.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Api\V1\CrmController::quickCreateContact
* @see app/Http/Controllers/Api/V1/CrmController.php:193
* @route '/api/v1/contacts/quick-create'
*/
quickCreateContactForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: quickCreateContact.url(options),
    method: 'post',
})

quickCreateContact.form = quickCreateContactForm

const CrmController = { customers, storeCustomer, showCustomer, updateCustomer, destroyCustomer, searchCustomers, quickCreateCustomer, sendCustomerEmail, sendCustomerSms, contacts, storeContact, showContact, updateContact, destroyContact, searchContacts, quickCreateContact }

export default CrmController