export type GetApiWorkManagementTenantLocatorTasksListArgs = {tenantLocator: string, offset?: number | undefined, count?: number | undefined}; export type GetApiWorkManagementTenantLocatorTasksListOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /work-management/{tenantLocator}/tasks/list */ export const getApiWorkManagementTenantLocatorTasksList = async (args: GetApiWorkManagementTenantLocatorTasksListArgs, options: GetApiWorkManagementTenantLocatorTasksListOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.offset != null) query.append("offset", String(args.offset)) if (args.count != null) query.append("count", String(args.count)) const url = `${baseUrl.replace(/\/+$/, '')}/work-management/${encodeURIComponent(String(args.tenantLocator))}/tasks/list${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 res.blob() };