feat: link_preview control for shareable assets (sync spec v0.7.10) - #70
Conversation
Regenerated from spec v0.7.10 (cloudglue/cloudglue-api-spec#104) and bumped to 0.7.17. Generated: - ShareableAsset gains a required link_preview ('none' | 'full') with enum validation; CreateShareableAssetRequest and UpdateShareableAssetRequest gain the optional field Wrapper: - Plumb link_preview through Share.create() and Share.update() (both build request models explicitly, so the field is otherwise unreachable) and document the private-share semantics: 'none' emits no Open Graph metadata, 'full' emits title, description, and thumbnail; public shares always emit full metadata Verified against the live API: create defaults to 'none', create with 'full' is honored, update toggles and persists on read-back, list responses carry the field, and invalid values are rejected by pydantic.
|
Important Review skippedToo many files! This PR contains 288 files, which is 188 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (288)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Syncs the SDK to spec v0.7.10 (cloudglue/cloudglue-api-spec#104) and bumps the package to 0.7.17.
Adds
link_preview, which lets callers opt private shares into rich Open Graph metadata for unfurl bots (Slack, iMessage, etc.). Values are'none'(API default — today's no-preview behavior) and'full'(title, description, thumbnail tags). Public shares always emit full metadata regardless.Generated (cloudglue/sdk)
ShareableAssetgains a requiredlink_previewwith enum validationCreateShareableAssetRequest/UpdateShareableAssetRequestgain the optional fieldWrapper (cloudglue/client)
Share.create()andShare.update()construct request models explicitly, solink_previewwould otherwise be unreachable — added the kwarg to both with docstrings covering the private-vs-public semanticsNone, whichto_dict(exclude_none=True)drops from the payload, so the server default applies (same pattern asvisibility)Test plan
'full'passes through; invalid value raises a pydantic validation error)'none'; create with'full'is honored; update toggles to'full'and back, persisting on read-back; list responses carry the field; an invalid enum value is rejected client-side — 7/7 checks passedNote
Low Risk
Additive API surface and wrapper parameters with defaults; no auth or breaking changes beyond a new required field on
ShareableAssetresponses from the spec.Overview
Syncs the generated SDK to OpenAPI 0.7.10 and bumps the published package to 0.7.17.
Adds
link_preview('none'|'full') for shareable assets so callers can control whether private share URLs emit Open Graph metadata for unfurl bots.'none'keeps the prior no-preview behavior (API default);'full'exposes title, description, and thumbnail tags. Public shares always emit full preview metadata regardless of this setting.The high-level
Share.create()andShare.update()wrappers now acceptlink_previewand forward it into the generated request models (omitting it leaves the field out of the payload so the server default applies). Generated modelsCreateShareableAssetRequest,UpdateShareableAssetRequest, andShareableAssetinclude the new field with enum validation.Reviewed by Cursor Bugbot for commit e329ae4. Bugbot is set up for automated code reviews on this repo. Configure here.