export type GetApiV1PoliciesIdEvidenceTasksArgs = {'X-Organization-Id'?: string | undefined, id: string}; export type GetApiV1PoliciesIdEvidenceTasksOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get tasks that serve as evidence for a policy, grouped by control * * GET /v1/policies/{id}/evidence-tasks */ export const getApiV1PoliciesIdEvidenceTasks = async (args: GetApiV1PoliciesIdEvidenceTasksArgs, options?: GetApiV1PoliciesIdEvidenceTasksOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Organization-Id'] != null) headers.set("X-Organization-Id", String(args['X-Organization-Id'])) if (apikey !== undefined) headers.set("X-API-Key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/policies/${encodeURIComponent(String(args.id))}/evidence-tasks${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 undefined };