// 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 { GetDevicePowerOkResponse, GetDevicePowersOkResponse, getDevicePowerOkResponseResponse, getDevicePowersOkResponseResponse, } from './models'; export class DevicePowerService extends BaseService { /** * List all available device powers * @returns {Promise>} Device Power Success Response */ async getDevicePowers(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/device_power'; const options: any = { responseSchema: getDevicePowersOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.get(path, options); } /** * Get power details of a single device from its given `{deviceId}`. * @param {string} deviceId - ID of the device * @returns {Promise>} Device Success Response */ async getDevicePower( deviceId: string, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/device_power/{deviceId}', { deviceId: deviceId }); const options: any = { responseSchema: getDevicePowerOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.get(path, options); } }