// 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 { GetGroupedLightOkResponse, GetGroupedLightsOkResponse, GroupedLightPut, UpdateGroupedLightOkResponse, getGroupedLightOkResponseResponse, getGroupedLightsOkResponseResponse, groupedLightPutRequest, updateGroupedLightOkResponseResponse, } from './models'; export class GroupedLightService extends BaseService { /** * List all grouped lights * @returns {Promise>} Grouped Light Success Response */ async getGroupedLights(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/grouped_light'; const options: any = { responseSchema: getGroupedLightsOkResponseResponse, 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 grouped light from its given `{groupedLightId}`. * @param {string} groupedLightId - ID of the grouped light * @returns {Promise>} Grouped Light Success Response */ async getGroupedLight( groupedLightId: string, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/grouped_light/{groupedLightId}', { groupedLightId: groupedLightId, }); const options: any = { responseSchema: getGroupedLightOkResponseResponse, 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 grouped light from its given `{groupedLightId}`. * @param {string} groupedLightId - ID of the light * @returns {Promise>} Success */ async updateGroupedLight( groupedLightId: string, body: GroupedLightPut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/grouped_light/{groupedLightId}', { groupedLightId: groupedLightId, }); const options: any = { responseSchema: updateGroupedLightOkResponseResponse, requestSchema: groupedLightPutRequest, 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); } }