export type AssetShareLinkSettings = {active?: boolean | undefined, allowDownload?: boolean | undefined, password?: (string | null) | undefined, expiresAt?: (string | null) | undefined, requireAccount?: boolean | undefined, comments?: ('hidden' | 'read_only' | 'allowed') | undefined, customFields?: ('hidden' | 'read_only' | 'editable') | undefined, showAllVersions?: boolean | undefined}; export type PatchApiV1AssetsAssetIdShareLinksShareLinkIdArgs = {body: AssetShareLinkSettings}; export type PatchApiV1AssetsAssetIdShareLinksShareLinkIdOptions = {baseUrl: string, ApiKeyAuth?: string | undefined, WorkspaceIdAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * /assets/:assetId/share-links/:shareLinkId * * PATCH /v1/assets/{assetId}/share-links/{shareLinkId} * * Also accepts auth: BearerAuth + WorkspaceIdAuth */ export const patchApiV1AssetsAssetIdShareLinksShareLinkId = async (args: PatchApiV1AssetsAssetIdShareLinksShareLinkIdArgs, options: PatchApiV1AssetsAssetIdShareLinksShareLinkIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKeyAuth, WorkspaceIdAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) if (WorkspaceIdAuth !== undefined) headers.set("x-air-workspace-id", WorkspaceIdAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets/${encodeURIComponent(String(args.assetId))}/share-links/${encodeURIComponent(String(args.shareLinkId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };