// 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 { GetMotionSensorOkResponse, GetMotionSensorsOkResponse, MotionPut, UpdateMotionSensorOkResponse, getMotionSensorOkResponseResponse, getMotionSensorsOkResponseResponse, motionPutRequest, updateMotionSensorOkResponseResponse, } from './models'; export class MotionService extends BaseService { /** * List all available motion sensors. * @returns {Promise>} Motion Success Response */ async getMotionSensors(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/motion'; const options: any = { responseSchema: getMotionSensorsOkResponseResponse, 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 motion sensor from its given `{motionId}`. * @param {string} motionId - ID of the motion sensor * @returns {Promise>} Motion Success Response */ async getMotionSensor( motionId: string, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/motion/{motionId}', { motionId: motionId }); const options: any = { responseSchema: getMotionSensorOkResponseResponse, 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 motion sensor from its given `{motionId}`. * @param {string} motionId - Id of the motion sensor * @returns {Promise>} Success */ async updateMotionSensor( motionId: string, body: MotionPut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/motion/{motionId}', { motionId: motionId }); const options: any = { responseSchema: updateMotionSensorOkResponseResponse, requestSchema: motionPutRequest, 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); } }