export type CreateApiV1AnalysisProfilesProfileIdDefaultArgs = {'App-ID': string, 'Auth-Token': string, profile_id: string}; export type CreateApiV1AnalysisProfilesProfileIdDefaultOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Set an analysis profile to the default of its media type * * POST /v1/analysis/profiles/{profile_id}/default/ */ export const createApiV1AnalysisProfilesProfileIdDefault = async (args: CreateApiV1AnalysisProfilesProfileIdDefaultArgs, options: CreateApiV1AnalysisProfilesProfileIdDefaultOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/analysis/profiles/${encodeURIComponent(String(args.profile_id))}/default/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };