/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import axios from '@aliasedDeps/api-services/axios'; import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import type { MessageReadParams, WebitelImApiGatewayV1InteractiveCallbackResponse, WebitelImApiGatewayV1MessageSendInteractiveCallbackBody, WebitelImApiGatewayV1ReadMessageResponse, WebitelImApiGatewayV1SendContactRequest, WebitelImApiGatewayV1SendDocumentRequest, WebitelImApiGatewayV1SendDocumentResponse, WebitelImApiGatewayV1SendInteractiveMessageRequest, WebitelImApiGatewayV1SendLocationRequest, WebitelImApiGatewayV1SendMessageResponse, WebitelImApiGatewayV1SendTextRequest, WebitelImApiGatewayV1SendTextResponse, } from '../_models'; // --- header start // export const // --- title start getWebitelImApiGatewayV1Message = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Sends a contact card. */ const messageSendContact = ( webitelImApiGatewayV1SendContactRequest: WebitelImApiGatewayV1SendContactRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/v1/messages/contact`, webitelImApiGatewayV1SendContactRequest, options, ); }; /** * @summary SendDocument delivers a document message. */ const messageSendDocument = ( webitelImApiGatewayV1SendDocumentRequest: WebitelImApiGatewayV1SendDocumentRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/v1/messages/document`, webitelImApiGatewayV1SendDocumentRequest, options, ); }; /** * @summary Sends an interactive message (buttons, lists, CTA). Supports idempotency via send_id. */ const messageSendInteractive = ( webitelImApiGatewayV1SendInteractiveMessageRequest: WebitelImApiGatewayV1SendInteractiveMessageRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/v1/messages/interactive`, webitelImApiGatewayV1SendInteractiveMessageRequest, options, ); }; /** * @summary Handles user interaction callbacks. Should be called by client when user interacts with UI. */ const messageSendInteractiveCallback = ( inReplyTo: string, webitelImApiGatewayV1MessageSendInteractiveCallbackBody: WebitelImApiGatewayV1MessageSendInteractiveCallbackBody, options?: AxiosRequestConfig, ): Promise< AxiosResponse > => { return axiosInstance.post( `/v1/messages/interactive/${inReplyTo}/callback`, webitelImApiGatewayV1MessageSendInteractiveCallbackBody, options, ); }; /** * @summary Sends a geographic location message. */ const messageSendLocation = ( webitelImApiGatewayV1SendLocationRequest: WebitelImApiGatewayV1SendLocationRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/v1/messages/location`, webitelImApiGatewayV1SendLocationRequest, options, ); }; /** * @summary SendText delivers a plain text message. We use the shared Request/Response types directly to avoid duplication. */ const messageSendText = ( webitelImApiGatewayV1SendTextRequest: WebitelImApiGatewayV1SendTextRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/v1/messages/text`, webitelImApiGatewayV1SendTextRequest, options, ); }; /** * @summary Mark message as read by id. */ const messageRead = ( id: string, params?: MessageReadParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post(`/v1/messages/${id}/read`, undefined, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { messageSendContact, messageSendDocument, messageSendInteractive, messageSendInteractiveCallback, messageSendLocation, messageSendText, messageRead, }; }; export type MessageSendContactResult = AxiosResponse; export type MessageSendDocumentResult = AxiosResponse; export type MessageSendInteractiveResult = AxiosResponse; export type MessageSendInteractiveCallbackResult = AxiosResponse; export type MessageSendLocationResult = AxiosResponse; export type MessageSendTextResult = AxiosResponse; export type MessageReadResult = AxiosResponse; // --- footer end