export type DeleteApiRbacPermissionChecksCheckUuidArgs = {check_uuid: string}; export type DeleteApiRbacPermissionChecksCheckUuidOptions = {baseUrl: string, authentik?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mixin to add a used_by endpoint to return a list of all objects using this object * * DELETE /rbac/permission_checks/{check_uuid}/ */ export const deleteApiRbacPermissionChecksCheckUuid = async (args: DeleteApiRbacPermissionChecksCheckUuidArgs, options: DeleteApiRbacPermissionChecksCheckUuidOptions) => { const {baseUrl, fetch: fetchFn = fetch, authentik} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (authentik !== undefined) headers.set('authorization', `Bearer ${authentik}`) const url = `${baseUrl.replace(/\/+$/, '')}/rbac/permission_checks/${encodeURIComponent(String(args.check_uuid))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };