Add --dry-run flag to share-link update#347
Merged
Merged
Conversation
Preview shared-link setting changes without calling the Dropbox API. Text output prints "Would update shared link <url>"; JSON reports status "planned" with dry_run=true in the input. The dry-run branch runs after URL and flag validation, so conflicting flags and bad input still error. The planned result reports a synthetic "link" kind with just the URL, since no metadata is fetched. Adds shareLinkJSONKindLink for that kind and shareLinkUpdateResultInput to carry dry_run in the per-result input, which was previously empty for this command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--dry-runflag todbxcli share-link update, matching the convention used bymkdir,rm,restore,mv,cp,put, andshare-link revoke.Would update shared link <url>without calling the Dropbox API.plannedwithdry_run=truein the input.The dry-run branch runs after URL validation and flag parsing, so conflicting flags (
--expires+--remove-expiration), invalid audience, and empty URL still error correctly during a preview.The planned result reports a synthetic
linkkind with just the URL, since no metadata is fetched (a real update returns the actualfile/folderkind). AddsshareLinkJSONKindLinkfor that kind andshareLinkUpdateResultInputto carrydry_runin the per-result input, which was previously empty for this command. Manifest, JSON contract test, and golden schema updated in lockstep; regenerated docs/schemas show no drift.Testing
go build ./...,go vet ./cmd/,gofmtcleango test ./...passesModifySharedLinkSettings,ModifySharedLinkSettingsRaw, andGetSharedLinkMetadataare never called during dry-run.