export type DeleteApiV2GruposIdArgs = {id: number}; export type DeleteApiV2GruposIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * /v2/grupos/{id} * * DELETE /v2/grupos/{id} */ export const deleteApiV2GruposId = async (args: DeleteApiV2GruposIdArgs, options?: DeleteApiV2GruposIdOptions) => { const {baseUrl = "https://totvssign.staging.totvs.app/identityintegration", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/v2/grupos/${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 (await res.json()) as unknown };