export type DeleteApiV1RolesClaimsIdArgs = {roleId?: string | undefined, id: number}; export type DeleteApiV1RolesClaimsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /V1/roles/claims/{id} */ export const deleteApiV1RolesClaimsId = async (args: DeleteApiV1RolesClaimsIdArgs, options: DeleteApiV1RolesClaimsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.roleId != null) query.append("roleId", String(args.roleId)) const url = `${baseUrl.replace(/\/+$/, '')}/V1/roles/claims/${encodeURIComponent(String(args.id))}${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 };