export type PendingRequestReportDto = {workflowName: string, pendingUser: string, startDate: string, endDate: string}; export type CreateApiApiReportsPendingrequestArgs = {body: PendingRequestReportDto}; export type CreateApiApiReportsPendingrequestOptions = {baseUrl: string, ApiKey?: string | undefined, UserKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get pending request details of the given workflow. * * POST /api/Reports/pendingrequest */ export const createApiApiReportsPendingrequest = async (args: CreateApiApiReportsPendingrequestArgs, options: CreateApiApiReportsPendingrequestOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey, UserKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) if (UserKey !== undefined) headers.set("X-User-Key", UserKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/Reports/pendingrequest${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };