// 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 { CreateSceneOkResponse, DeleteSceneOkResponse, GetSceneOkResponse, GetScenesOkResponse, ScenePost, ScenePut, UpdateSceneOkResponse, createSceneOkResponseResponse, deleteSceneOkResponseResponse, getSceneOkResponseResponse, getScenesOkResponseResponse, scenePostRequest, scenePutRequest, updateSceneOkResponseResponse, } from './models'; export class SceneService extends BaseService { /** * List all available scenes * @returns {Promise>} Scene Success Response */ async getScenes(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/scene'; const options: any = { responseSchema: getScenesOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.get(path, options); } /** * Creates a new scene * @returns {Promise>} Success */ async createScene(body: ScenePost, requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/scene'; const options: any = { responseSchema: createSceneOkResponseResponse, requestSchema: scenePostRequest, body: body as any, headers: { 'Content-Type': 'application/json', }, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.post(path, options); } /** * Get details of a single scene from its given `{sceneId}` * @param {string} sceneId - ID of the scene. * @returns {Promise>} Scene Success Response */ async getScene(sceneId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/scene/{sceneId}', { sceneId: sceneId }); const options: any = { responseSchema: getSceneOkResponseResponse, 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 scene from its given `{sceneId}` * @param {string} sceneId - ID of the scene. * @returns {Promise>} Success */ async updateScene( sceneId: string, body: ScenePut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/scene/{sceneId}', { sceneId: sceneId }); const options: any = { responseSchema: updateSceneOkResponseResponse, requestSchema: scenePutRequest, 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); } /** * Delete a single scene from its given `{sceneId}` * @param {string} sceneId - ID of the scene. * @returns {Promise>} Success */ async deleteScene(sceneId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/scene/{sceneId}', { sceneId: sceneId }); const options: any = { responseSchema: deleteSceneOkResponseResponse, requestSchema: z.any(), headers: {}, requestContentType: ContentType.Json, responseContentType: ContentType.Json, retry: requestConfig?.retry, config: this.config, }; return this.client.delete(path, options); } }