export type GetApiV1InstallmentsInstallmentIdSchedulesArgs = {installmentId: string}; export type GetApiV1InstallmentsInstallmentIdSchedulesOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Listar Agendamentos do Parcelamento * * GET /v1/installments/{installmentId}/schedules */ export const getApiV1InstallmentsInstallmentIdSchedules = async (args: GetApiV1InstallmentsInstallmentIdSchedulesArgs, options?: GetApiV1InstallmentsInstallmentIdSchedulesOptions) => { const {baseUrl = "https://api.nibo.com.br/empresas", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (sec0 !== undefined) headers.set("apitoken", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/v1/installments/${encodeURIComponent(String(args.installmentId))}/schedules${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 };