export type GetApiApiProjectIdRawDataSampleIdVideoArgs = {projectId: number, sampleId: number, afterInputBlock?: boolean | undefined, cacheKey?: string | undefined, impulseId?: number | undefined, datastreamIndex?: number | undefined, datasetVersionId?: number | undefined}; export type GetApiApiProjectIdRawDataSampleIdVideoOptions = {baseUrl?: string | undefined, ApiKeyAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get video file * * GET /api/{projectId}/raw-data/{sampleId}/video * * Also accepts auth: JWTAuthentication, JWTHttpHeaderAuthentication, OAuth2 */ export const getApiApiProjectIdRawDataSampleIdVideo = async (args: GetApiApiProjectIdRawDataSampleIdVideoArgs, options?: GetApiApiProjectIdRawDataSampleIdVideoOptions) => { const {baseUrl = "https://studio.edgeimpulse.com/v1", fetch: fetchFn = fetch, ApiKeyAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "video/mp4") if (args.afterInputBlock != null) query.append("afterInputBlock", String(args.afterInputBlock)) if (args.cacheKey != null) query.append("cacheKey", String(args.cacheKey)) if (args.impulseId != null) query.append("impulseId", String(args.impulseId)) if (args.datastreamIndex != null) query.append("datastreamIndex", String(args.datastreamIndex)) if (args.datasetVersionId != null) query.append("datasetVersionId", String(args.datasetVersionId)) if (ApiKeyAuthentication !== undefined) headers.set("x-api-key", ApiKeyAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.projectId))}/raw-data/${encodeURIComponent(String(args.sampleId))}/video${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };