export type GetApiTaxScheduleTaxScheduleIdChangelogArgs = {TaxScheduleId: string}; export type GetApiTaxScheduleTaxScheduleIdChangelogOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the changelog for a TaxSchedule for the specified id * * GET /TaxSchedule/{TaxScheduleId}/changelog */ export const getApiTaxScheduleTaxScheduleIdChangelog = async (args: GetApiTaxScheduleTaxScheduleIdChangelogArgs, options?: GetApiTaxScheduleTaxScheduleIdChangelogOptions) => { const {baseUrl = "https://yourorgsite.com/api", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/TaxSchedule/${encodeURIComponent(String(args.TaxScheduleId))}/changelog${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 undefined };