import type { AxiosRequestConfig } from 'axios' ; import type { HttpClient } from '../../http' ; import type { ConversationRolesList } from '../../conversation/ConversationRole' ; import type { TeamConversationList , TeamConversation } from './TeamConversation' ; export class TeamConversationAPI { constructor ( private readonly client ) { } public static readonly URL = { CONVERSATIONS : 'conversations' , ROLES : 'roles' , TEAMS : '/teams' , } ; param teamId param conversationId see https public async deleteConversation ( teamId , conversationId ) { const config = { method : 'delete' , url : `${ TeamConversationAPI . URL . TEAMS }/${ teamId }/${ TeamConversationAPI . URL . CONVERSATIONS }/${ conversationId }` , } ; await this . client . sendJSON ( config ) ; } param teamId param conversationId see https public async getConversation ( teamId , conversationId ) { const config = { method : 'get' , url : `${ TeamConversationAPI . URL . TEAMS }/${ teamId }/${ TeamConversationAPI . URL . CONVERSATIONS }/${ conversationId }` , } ; const response = await this . client . sendJSON < TeamConversation > ( config ) ; return response . data ; } param teamId see https public async getConversations ( teamId ) { const config = { method : 'get' , url : `${ TeamConversationAPI . URL . TEAMS }/${ teamId }/${ TeamConversationAPI . URL . CONVERSATIONS }` , } ; const response = await this . client . sendJSON < TeamConversationList > ( config ) ; return response . data ; } param teamId see https public async getRoles ( teamId ) { const config = { method : 'get' , url : `${ TeamConversationAPI . URL . TEAMS }/${ teamId }/${ TeamConversationAPI . URL . CONVERSATIONS }/${ TeamConversationAPI . URL . ROLES }` , } ; const response = await this . client . sendJSON < ConversationRolesList > ( config ) ; return response . data ; } }