export type GetApiV1InternalMeasurementReadyScansArgs = {limit?: number | undefined, offset?: number | undefined, customerId?: string | undefined, scanIds?: string | undefined}; export type GetApiV1InternalMeasurementReadyScansOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/internal/measurement-ready-scans */ export const getApiV1InternalMeasurementReadyScans = async (args: GetApiV1InternalMeasurementReadyScansArgs, options: GetApiV1InternalMeasurementReadyScansOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.limit != null) query.append("limit", String(args.limit)) if (args.offset != null) query.append("offset", String(args.offset)) if (args.customerId != null) query.append("customerId", String(args.customerId)) if (args.scanIds != null) query.append("scanIds", String(args.scanIds)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/internal/measurement-ready-scans${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 };