export type GetApiApiAccountDeletionRequestsArgs = {endDateTime?: string | undefined, startDateTime?: string | undefined, subjectType?: string | undefined}; export type GetApiApiAccountDeletionRequestsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * listAccountDeletionRequestBySubjectTypeAndStartEndTime * * GET /api/accountDeletionRequests */ export const getApiApiAccountDeletionRequests = async (args: GetApiApiAccountDeletionRequestsArgs, options: GetApiApiAccountDeletionRequestsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.endDateTime != null) query.append("endDateTime", String(args.endDateTime)) if (args.startDateTime != null) query.append("startDateTime", String(args.startDateTime)) if (args.subjectType != null) query.append("subjectType", String(args.subjectType)) const url = `${baseUrl.replace(/\/+$/, '')}/api/accountDeletionRequests${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() };