// 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 { GetLightLevelOkResponse, GetLightLevelsOkResponse, LightLevelPut, UpdateLightLevelOkResponse, getLightLevelOkResponseResponse, getLightLevelsOkResponseResponse, lightLevelPutRequest, updateLightLevelOkResponseResponse, } from './models'; export class LightLevelService extends BaseService { /** * List all available light levels. * @returns {Promise>} Light Level Success Response */ async getLightLevels(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/light_level'; const options: any = { responseSchema: getLightLevelsOkResponseResponse, 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 Level Success Response */ async getLightLevel(lightId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/light_level/{lightId}', { lightId: lightId }); const options: any = { responseSchema: getLightLevelOkResponseResponse, 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 updateLightLevel( lightId: string, body: LightLevelPut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/light_level/{lightId}', { lightId: lightId }); const options: any = { responseSchema: updateLightLevelOkResponseResponse, requestSchema: lightLevelPutRequest, 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); } }