export type GetApiApiOrganizationsOrganizationIdDatasetDatasetFilesViewArgs = {organizationId: number, dataset: string, path: string}; export type GetApiApiOrganizationsOrganizationIdDatasetDatasetFilesViewOptions = {baseUrl?: string | undefined, ApiKeyAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * View file from dataset * * GET /api/organizations/{organizationId}/dataset/{dataset}/files/view * * Also accepts auth: JWTAuthentication, JWTHttpHeaderAuthentication, OAuth2 */ export const getApiApiOrganizationsOrganizationIdDatasetDatasetFilesView = async (args: GetApiApiOrganizationsOrganizationIdDatasetDatasetFilesViewArgs, options?: GetApiApiOrganizationsOrganizationIdDatasetDatasetFilesViewOptions) => { const {baseUrl = "https://studio.edgeimpulse.com/v1", fetch: fetchFn = fetch, ApiKeyAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (args.path != null) query.append("path", String(args.path)) if (ApiKeyAuthentication !== undefined) headers.set("x-api-key", ApiKeyAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/api/organizations/${encodeURIComponent(String(args.organizationId))}/dataset/${encodeURIComponent(String(args.dataset))}/files/view${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() };