// 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 { CreateZoneOkResponse, DeleteZoneOkResponse, GetZoneOkResponse, GetZonesOkResponse, UpdateZoneOkResponse, createZoneOkResponseResponse, deleteZoneOkResponseResponse, getZoneOkResponseResponse, getZonesOkResponseResponse, updateZoneOkResponseResponse, } from './models'; import { RoomPut, roomPutRequest } from '../common'; export class ZoneService extends BaseService { /** * List all available zones * @returns {Promise>} Zone Success Response */ async getZones(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/zone'; const options: any = { responseSchema: getZonesOkResponseResponse, 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 zone * @returns {Promise>} Success */ async createZone(body: RoomPut, requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/zone'; const options: any = { responseSchema: createZoneOkResponseResponse, 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 Zone from its given `{zoneId}` * @param {string} zoneId - ID of the Zone * @returns {Promise>} Zone Success Response */ async getZone(zoneId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/zone/{zoneId}', { zoneId: zoneId }); const options: any = { responseSchema: getZoneOkResponseResponse, 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 Zone from its given `{zoneId}` * @param {string} zoneId - ID of the Zone * @returns {Promise>} Success */ async updateZone( zoneId: string, body: RoomPut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/zone/{zoneId}', { zoneId: zoneId }); const options: any = { responseSchema: updateZoneOkResponseResponse, 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 Zone from its given `{zoneId}` * @param {string} zoneId - ID of the Zone * @returns {Promise>} Success */ async deleteZone(zoneId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/zone/{zoneId}', { zoneId: zoneId }); const options: any = { responseSchema: deleteZoneOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.delete(path, options); } }