import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition, applyUrlDefaults } from './../../../../wayfinder'
/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
export const status = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: status.url(options),
    method: 'get',
})

status.definition = {
    methods: ["get","head"],
    url: 'https://bidora.com.ng/support/chat-api/status',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
status.url = (options?: RouteQueryOptions) => {
    return status.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
status.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: status.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
status.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: status.url(options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
const statusForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: status.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
statusForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: status.url(options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::status
* @see app/Http/Controllers/Support/CustomerChatController.php:31
* @route 'https://bidora.com.ng/support/chat-api/status'
*/
statusForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: status.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

status.form = statusForm

/**
* @see \App\Http\Controllers\Support\CustomerChatController::initiate
* @see app/Http/Controllers/Support/CustomerChatController.php:43
* @route 'https://bidora.com.ng/support/chat-api/initiate'
*/
export const initiate = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: initiate.url(options),
    method: 'post',
})

initiate.definition = {
    methods: ["post"],
    url: 'https://bidora.com.ng/support/chat-api/initiate',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Support\CustomerChatController::initiate
* @see app/Http/Controllers/Support/CustomerChatController.php:43
* @route 'https://bidora.com.ng/support/chat-api/initiate'
*/
initiate.url = (options?: RouteQueryOptions) => {
    return initiate.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Support\CustomerChatController::initiate
* @see app/Http/Controllers/Support/CustomerChatController.php:43
* @route 'https://bidora.com.ng/support/chat-api/initiate'
*/
initiate.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: initiate.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::initiate
* @see app/Http/Controllers/Support/CustomerChatController.php:43
* @route 'https://bidora.com.ng/support/chat-api/initiate'
*/
const initiateForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: initiate.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::initiate
* @see app/Http/Controllers/Support/CustomerChatController.php:43
* @route 'https://bidora.com.ng/support/chat-api/initiate'
*/
initiateForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: initiate.url(options),
    method: 'post',
})

initiate.form = initiateForm

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
export const messages = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: messages.url(args, options),
    method: 'get',
})

messages.definition = {
    methods: ["get","head"],
    url: 'https://bidora.com.ng/support/chat-api/{uuid}/messages',
} satisfies RouteDefinition<["get","head"]>

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
messages.url = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { uuid: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        uuid: args.uuid,
    }

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

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
messages.get = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: messages.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
messages.head = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: messages.url(args, options),
    method: 'head',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
const messagesForm = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: messages.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
messagesForm.get = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: messages.url(args, options),
    method: 'get',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::messages
* @see app/Http/Controllers/Support/CustomerChatController.php:78
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/messages'
*/
messagesForm.head = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: messages.url(args, {
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

messages.form = messagesForm

/**
* @see \App\Http\Controllers\Support\CustomerChatController::send
* @see app/Http/Controllers/Support/CustomerChatController.php:102
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/message'
*/
export const send = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: send.url(args, options),
    method: 'post',
})

send.definition = {
    methods: ["post"],
    url: 'https://bidora.com.ng/support/chat-api/{uuid}/message',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Support\CustomerChatController::send
* @see app/Http/Controllers/Support/CustomerChatController.php:102
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/message'
*/
send.url = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions) => {
    if (typeof args === 'string' || typeof args === 'number') {
        args = { uuid: args }
    }

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

    args = applyUrlDefaults(args)

    const parsedArgs = {
        uuid: args.uuid,
    }

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

/**
* @see \App\Http\Controllers\Support\CustomerChatController::send
* @see app/Http/Controllers/Support/CustomerChatController.php:102
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/message'
*/
send.post = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: send.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::send
* @see app/Http/Controllers/Support/CustomerChatController.php:102
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/message'
*/
const sendForm = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: send.url(args, options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::send
* @see app/Http/Controllers/Support/CustomerChatController.php:102
* @route 'https://bidora.com.ng/support/chat-api/{uuid}/message'
*/
sendForm.post = (args: { uuid: string | number } | [uuid: string | number ] | string | number, options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: send.url(args, options),
    method: 'post',
})

send.form = sendForm

/**
* @see \App\Http\Controllers\Support\CustomerChatController::offlineTicket
* @see app/Http/Controllers/Support/CustomerChatController.php:155
* @route 'https://bidora.com.ng/support/chat-api/offline-ticket'
*/
export const offlineTicket = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: offlineTicket.url(options),
    method: 'post',
})

offlineTicket.definition = {
    methods: ["post"],
    url: 'https://bidora.com.ng/support/chat-api/offline-ticket',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Support\CustomerChatController::offlineTicket
* @see app/Http/Controllers/Support/CustomerChatController.php:155
* @route 'https://bidora.com.ng/support/chat-api/offline-ticket'
*/
offlineTicket.url = (options?: RouteQueryOptions) => {
    return offlineTicket.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Support\CustomerChatController::offlineTicket
* @see app/Http/Controllers/Support/CustomerChatController.php:155
* @route 'https://bidora.com.ng/support/chat-api/offline-ticket'
*/
offlineTicket.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: offlineTicket.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::offlineTicket
* @see app/Http/Controllers/Support/CustomerChatController.php:155
* @route 'https://bidora.com.ng/support/chat-api/offline-ticket'
*/
const offlineTicketForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: offlineTicket.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Support\CustomerChatController::offlineTicket
* @see app/Http/Controllers/Support/CustomerChatController.php:155
* @route 'https://bidora.com.ng/support/chat-api/offline-ticket'
*/
offlineTicketForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: offlineTicket.url(options),
    method: 'post',
})

offlineTicket.form = offlineTicketForm

const api = {
    status: Object.assign(status, status),
    initiate: Object.assign(initiate, initiate),
    messages: Object.assign(messages, messages),
    send: Object.assign(send, send),
    offlineTicket: Object.assign(offlineTicket, offlineTicket),
}

export default api