export type FeaturesDocumentsReviewReviewDocumentCommandReviewStatus = 1 | 2; export type FeaturesDocumentsReviewReviewDocumentCommandReviewDocumentCommandBody = {documentIds?: (Array | null) | undefined, remark?: (string | null) | undefined, reviewStatus?: FeaturesDocumentsReviewReviewDocumentCommandReviewStatus | undefined}; export type CreateApiHubsHubHashIdProjectsProjectIdDocumentsReviewArgs = {HubHashId: string, ProjectId: number, body: FeaturesDocumentsReviewReviewDocumentCommandReviewDocumentCommandBody}; export type CreateApiHubsHubHashIdProjectsProjectIdDocumentsReviewOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Review document * * POST /hubs/{HubHashId}/projects/{ProjectId}/documents/review */ export const createApiHubsHubHashIdProjectsProjectIdDocumentsReview = async (args: CreateApiHubsHubHashIdProjectsProjectIdDocumentsReviewArgs, options?: CreateApiHubsHubHashIdProjectsProjectIdDocumentsReviewOptions) => { const {baseUrl = "https://docs.bimtrackapp.co", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/hubs/${encodeURIComponent(String(args.HubHashId))}/projects/${encodeURIComponent(String(args.ProjectId))}/documents/review${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 };