export type GetApiV2PublicacoesIdArgs = {id: number}; export type GetApiV2PublicacoesIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * /v2/publicacoes/{id} * * GET /v2/publicacoes/{id} */ export const getApiV2PublicacoesId = async (args: GetApiV2PublicacoesIdArgs, options?: GetApiV2PublicacoesIdOptions) => { 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/publicacoes/${encodeURIComponent(String(args.id))}${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 (await res.json()) as unknown };