/** * 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 { ThreadPermissionUpdateParams, WebitelImApiGatewayV1GetThreadPermissionsResponse, WebitelImApiGatewayV1UpdateThreadPermissionsResponse, } from '../_models'; // --- header start // export const // --- title start getWebitelImApiGatewayV1Threadpermission = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Get returns all permissions for the specified thread. Optional filter by member_id to get permissions for a specific member. */ const threadPermissionGet = ( threadId: string, memberId: string, options?: AxiosRequestConfig, ): Promise< AxiosResponse > => { return axiosInstance.get( `/v1/threads/${threadId}/members/${memberId}/permissions`, options, ); }; /** * @summary Update updates permissions for a specific member in the thread. The request must include the thread_id and member_id, along with the permissions to update. */ const threadPermissionUpdate = ( threadId: string, memberId: string, params?: ThreadPermissionUpdateParams, options?: AxiosRequestConfig, ): Promise< AxiosResponse > => { return axiosInstance.patch( `/v1/threads/${threadId}/members/${memberId}/permissions`, undefined, { ...options, params: { ...params, ...options?.params, }, }, ); }; // --- footer start return { threadPermissionGet, threadPermissionUpdate, }; }; export type ThreadPermissionGetResult = AxiosResponse; export type ThreadPermissionUpdateResult = AxiosResponse; // --- footer end