export type UpdateContentLibraryDocumentBody = {clear_expires_at?: boolean | undefined, description?: string | undefined, document_type?: string | undefined, expires_at?: string | undefined, internal_notes?: string | undefined, name?: string | undefined, uuid: string}; export type CreateApiTrustExchangeContentLibraryDocumentUpdateArgs = {body: UpdateContentLibraryDocumentBody}; export type CreateApiTrustExchangeContentLibraryDocumentUpdateOptions = {baseUrl?: string | undefined, APIKeyInHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update content library document * * POST /trust_exchange/content_library/document/update */ export const createApiTrustExchangeContentLibraryDocumentUpdate = async (args: CreateApiTrustExchangeContentLibraryDocumentUpdateArgs, options?: CreateApiTrustExchangeContentLibraryDocumentUpdateOptions) => { const {baseUrl = "https://cyber-risk.upguard.com/api/public", fetch: fetchFn = fetch, APIKeyInHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (APIKeyInHeader !== undefined) headers.set("Authorization", APIKeyInHeader) const url = `${baseUrl.replace(/\/+$/, '')}/trust_exchange/content_library/document/update${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 };