// 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 { BridgePut, GetBridgeOkResponse, GetBridgesOkResponse, UpdateBridgeOkResponse, bridgePutRequest, getBridgeOkResponseResponse, getBridgesOkResponseResponse, updateBridgeOkResponseResponse, } from './models'; export class BridgeService extends BaseService { /** * List all available bridges * @returns {Promise>} Bridge Success Response */ async getBridges(requestConfig?: RequestConfig): Promise> { const path = '/clip/v2/resource/bridge'; const options: any = { responseSchema: getBridgesOkResponseResponse, 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 bridge from its given `{bridgeId}`. * @param {string} bridgeId - ID of the bridge * @returns {Promise>} Bridge Success Response */ async getBridge(bridgeId: string, requestConfig?: RequestConfig): Promise> { const path = this.client.buildPath('/clip/v2/resource/bridge/{bridgeId}', { bridgeId: bridgeId }); const options: any = { responseSchema: getBridgeOkResponseResponse, 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 bridge from its given `{bridgeId}`. * @param {string} bridgeId - ID of the bridge * @returns {Promise>} Success */ async updateBridge( bridgeId: string, body: BridgePut, requestConfig?: RequestConfig, ): Promise> { const path = this.client.buildPath('/clip/v2/resource/bridge/{bridgeId}', { bridgeId: bridgeId }); const options: any = { responseSchema: updateBridgeOkResponseResponse, requestSchema: bridgePutRequest, 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); } }