export type QueryResultType = 'Items' | 'Count' | 'ItemsWithCount'; export type ObjectStatus = 'Active' | 'Inactive'; export type GetApiApiTenantsTenantIdPayrunsPayrunIdParametersArgs = {tenantId: number, payrunId: number, apply?: string | undefined, filter?: string | undefined, orderBy?: string | undefined, result?: QueryResultType | undefined, select?: string | undefined, skip?: number | undefined, status?: ObjectStatus | undefined, top?: number | undefined}; export type GetApiApiTenantsTenantIdPayrunsPayrunIdParametersOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/tenants/{tenantId}/payruns/{payrunId}/parameters */ export const getApiApiTenantsTenantIdPayrunsPayrunIdParameters = async (args: GetApiApiTenantsTenantIdPayrunsPayrunIdParametersArgs, options: GetApiApiTenantsTenantIdPayrunsPayrunIdParametersOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.apply != null) query.append("apply", String(args.apply)) if (args.filter != null) query.append("filter", String(args.filter)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.result != null) query.append("result", String(args.result)) if (args.select != null) query.append("select", String(args.select)) if (args.skip != null) query.append("skip", String(args.skip)) if (args.status != null) query.append("status", String(args.status)) if (args.top != null) query.append("top", String(args.top)) const url = `${baseUrl.replace(/\/+$/, '')}/api/tenants/${encodeURIComponent(String(args.tenantId))}/payruns/${encodeURIComponent(String(args.payrunId))}/parameters${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 };