// 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 { GetLightOkResponse, GetLightsOkResponse, LightPut, UpdateLightOkResponse, getLightOkResponseResponse, getLightsOkResponseResponse, lightPutRequest, updateLightOkResponseResponse, } from './models'; export class LightService extends BaseService { /** * List all available lights. * @returns {Promise>} Light Success Response */ async getLights(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/light'; const options: any = { responseSchema: getLightsOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.get(path, options); } /** * Get details of a single light from its given `{lightId}`. * @param {string} lightId - ID of the light * @returns {Promise>} Light Success Response */ async getLight(lightId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/light/{lightId}', { lightId: lightId }); const options: any = { responseSchema: getLightOkResponseResponse, 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 light from its given `{lightId}`. * @param {string} lightId - ID of the light * @returns {Promise>} Success */ async updateLight( lightId: string, body: LightPut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/light/{lightId}', { lightId: lightId }); const options: any = { responseSchema: updateLightOkResponseResponse, requestSchema: lightPutRequest, 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); } }