// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { BaseService } from '../base-service'; import { ContentType, HttpResponse } from '../../http'; import { RequestConfig } from '../../http/types'; import { CreateRoomOkResponse, DeleteRoomOkResponse, GetRoomOkResponse, GetRoomsOkResponse, UpdateRoomOkResponse, createRoomOkResponseResponse, deleteRoomOkResponseResponse, getRoomOkResponseResponse, getRoomsOkResponseResponse, updateRoomOkResponseResponse, } from './models'; import { RoomPut, roomPutRequest } from '../common'; export class RoomService extends BaseService { /** * List all available rooms * @returns {Promise>} Room Success Response */ async getRooms(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/room'; const options: any = { responseSchema: getRoomsOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.get(path, options); } /** * Create a new room * @returns {Promise>} Success */ async createRoom(body: RoomPut, requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/room'; const options: any = { responseSchema: createRoomOkResponseResponse, requestSchema: roomPutRequest, body: body as any, headers: { 'Content-Type': 'application/json', }, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.post(path, options); } /** * Get details of a single room from its given `{roomId}` * @param {string} roomId - ID of the room * @returns {Promise>} Room Success Response */ async getRoom(roomId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/room/{roomId}', { roomId: roomId }); const options: any = { responseSchema: getRoomOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.get(path, options); } /** * Update a single room from its given `{roomId}` * @param {string} roomId - ID of the room * @returns {Promise>} Success */ async updateRoom( roomId: string, body: RoomPut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/room/{roomId}', { roomId: roomId }); const options: any = { responseSchema: updateRoomOkResponseResponse, requestSchema: roomPutRequest, body: body as any, headers: { 'Content-Type': 'application/json', }, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.put(path, options); } /** * Delete a single room from its given `{roomId}` * @param {string} roomId - ID of the room * @returns {Promise>} Success */ async deleteRoom(roomId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/room/{roomId}', { roomId: roomId }); const options: any = { responseSchema: deleteRoomOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.delete(path, options); } }