export type GetApiApiOrganizationsOrganizationIdJobsJobIdStdoutDownloadArgs = {organizationId: number, jobId: number, limit?: number | undefined, logLevel?: ('error' | 'warn' | 'info' | 'debug') | undefined}; export type GetApiApiOrganizationsOrganizationIdJobsJobIdStdoutDownloadOptions = {baseUrl?: string | undefined, ApiKeyAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download logs * * GET /api/organizations/{organizationId}/jobs/{jobId}/stdout/download * * Also accepts auth: JWTAuthentication, JWTHttpHeaderAuthentication, OAuth2 */ export const getApiApiOrganizationsOrganizationIdJobsJobIdStdoutDownload = async (args: GetApiApiOrganizationsOrganizationIdJobsJobIdStdoutDownloadArgs, options?: GetApiApiOrganizationsOrganizationIdJobsJobIdStdoutDownloadOptions) => { const {baseUrl = "https://studio.edgeimpulse.com/v1", fetch: fetchFn = fetch, ApiKeyAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args.limit != null) query.append("limit", String(args.limit)) if (args.logLevel != null) query.append("logLevel", String(args.logLevel)) if (ApiKeyAuthentication !== undefined) headers.set("x-api-key", ApiKeyAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/api/organizations/${encodeURIComponent(String(args.organizationId))}/jobs/${encodeURIComponent(String(args.jobId))}/stdout/download${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.text() };