export type DivisionScope = 'All' | 'Local' | 'Global' | 'GlobalAndLocal'; export type QueryResultType = 'Items' | 'Count' | 'ItemsWithCount'; export type ObjectStatus = 'Active' | 'Inactive'; export type GetApiApiTenantsTenantIdCompanycasesArgs = {tenantId: number, divisionId?: number | undefined, apply?: string | undefined, caseFieldName?: string | undefined, caseName?: string | undefined, divisionScope?: DivisionScope | undefined, filter?: string | undefined, orderBy?: string | undefined, result?: QueryResultType | undefined, select?: string | undefined, skip?: number | undefined, status?: ObjectStatus | undefined, top?: number | undefined}; export type GetApiApiTenantsTenantIdCompanycasesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/tenants/{tenantId}/companycases */ export const getApiApiTenantsTenantIdCompanycases = async (args: GetApiApiTenantsTenantIdCompanycasesArgs, options: GetApiApiTenantsTenantIdCompanycasesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.divisionId != null) query.append("divisionId", String(args.divisionId)) if (args.apply != null) query.append("apply", String(args.apply)) if (args.caseFieldName != null) query.append("caseFieldName", String(args.caseFieldName)) if (args.caseName != null) query.append("caseName", String(args.caseName)) if (args.divisionScope != null) query.append("divisionScope", String(args.divisionScope)) 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))}/companycases${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 };