export type CreateApiTrustExchangeContentLibraryDocumentArchiveArgs = {uuid: string, set_archived: boolean}; export type CreateApiTrustExchangeContentLibraryDocumentArchiveOptions = {baseUrl?: string | undefined, APIKeyInHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive content library document * * POST /trust_exchange/content_library/document/archive */ export const createApiTrustExchangeContentLibraryDocumentArchive = async (args: CreateApiTrustExchangeContentLibraryDocumentArchiveArgs, options?: CreateApiTrustExchangeContentLibraryDocumentArchiveOptions) => { const {baseUrl = "https://cyber-risk.upguard.com/api/public", fetch: fetchFn = fetch, APIKeyInHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.uuid != null) query.append("uuid", String(args.uuid)) if (args.set_archived != null) query.append("set_archived", String(args.set_archived)) if (APIKeyInHeader !== undefined) headers.set("Authorization", APIKeyInHeader) const url = `${baseUrl.replace(/\/+$/, '')}/trust_exchange/content_library/document/archive${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };