MCPcopy Create free account
hub / github.com/dropbox/dbxcli / jsonGoldenSuccessOutputExamples

Function jsonGoldenSuccessOutputExamples

cmd/json_contract_test.go:697–815  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

695}
696
697func jsonGoldenSuccessOutputExamples() map[string]jsonOperationOutput {
698 file := sampleJSONFileMetadata("/Reports/old.pdf")
699 copyFile := sampleJSONFileMetadata("/Reports/copy.pdf")
700 folder := sampleJSONFolderMetadata("/Reports")
701 sharedLink := sampleShareLinkJSONMetadata()
702 teamMember := sampleTeamMemberJSON()
703
704 examples := map[string]jsonOperationOutput{
705 "account": newJSONOperationOutput(accountInput{AccountID: "dbid:lookup"}, []jsonOperationResult{
706 newJSONOperationResult(accountJSONStatusFound, accountKindAccount, accountInput{AccountID: "dbid:lookup"}, sampleJSONAccount()),
707 }, nil),
708 "cp": newJSONOperationOutput(nil, []jsonOperationResult{
709 newJSONOperationResult(relocationJSONStatusCopied, copyFile.Type, relocationInput{FromPath: "/Reports/old.pdf", ToPath: "/Reports/copy.pdf"}, copyFile),
710 }, nil),
711 "du": newJSONOperationOutput(duInput{}, []jsonOperationResult{
712 newJSONOperationResult(duJSONStatusReported, duKindSpaceUsage, duInput{}, duOutput{
713 Used: 2048,
714 Allocation: duAllocation{
715 Type: "team",
716 Allocated: uint64Ptr(1000000),
717 Used: uint64Ptr(2048),
718 UserWithinTeamSpaceAllocated: uint64Ptr(500000),
719 UserWithinTeamSpaceUsedCached: uint64Ptr(1024),
720 UserWithinTeamSpaceLimitType: "fixed",
721 },
722 }),
723 }, nil),
724 "get": newJSONOperationOutput(getCommandInput{Source: "/Reports/old.pdf", Target: "old.pdf", Recursive: false, Stdout: false}, []jsonOperationResult{
725 newJSONOperationResult(getStatusDownloaded, getKindFile, getResultInput{Source: "/Reports/old.pdf", Target: "old.pdf"}, file),
726 }, nil),
727 "help": newJSONOperationOutput(jsonHelpInput{Help: true, Path: "ls"}, []jsonOperationResult{
728 newJSONOperationResult(jsonHelpStatusDescribed, jsonHelpKindCommand, nil, jsonCommandManifestFor(lsCmd)),
729 }, nil),
730 "ls": newJSONOperationOutput(lsInput{Path: "/Reports", Recursive: false, IncludeDeleted: true, OnlyDeleted: false, Long: true, Sort: "type", Reverse: false, Time: "server", TimeFormat: "2006-01-02"}, []jsonOperationResult{
731 newJSONOperationResult(lsJSONStatusListed, file.Type, nil, file),
732 }, nil),
733 "logout": newJSONOperationOutput(nil, []jsonOperationResult{
734 newJSONOperationResult(logoutStatusLoggedOut, logoutKindAuth, nil, logoutResult{RemovedSavedCredentials: true, RemoteTokenRevoked: true}),
735 }, nil),
736 "mkdir": newJSONOperationOutput(mkdirInput{Path: "/Reports/new", Parents: true}, []jsonOperationResult{
737 newJSONOperationResult(mkdirStatusCreated, mkdirKindFolder, mkdirInput{Path: "/Reports/new", Parents: true}, sampleJSONFolderMetadata("/Reports/new")),
738 }, nil),
739 "mv": newJSONOperationOutput(nil, []jsonOperationResult{
740 newJSONOperationResult(relocationJSONStatusMoved, "file", relocationInput{FromPath: "/Reports/copy.pdf", ToPath: "/Reports/moved.pdf"}, sampleJSONFileMetadata("/Reports/moved.pdf")),
741 }, nil),
742 "put": newJSONOperationOutput(putCommandInput{Source: "README.md", Target: "/README.md", Recursive: true, IfExists: putIfExistsOverwrite, Stdin: false}, []jsonOperationResult{
743 newJSONOperationResult(putStatusUploaded, putKindFile, putResultInput{Source: "README.md", Target: "/README.md"}, sampleJSONFileMetadata("/README.md")),
744 }, []jsonWarning{{Code: jsonWarningCodeSkippedSymlink, Message: "skipped symlink", Path: "docs/link"}}),
745 "restore": newJSONOperationOutput(restoreInput{Path: "/Reports/old.pdf", Revision: "015f"}, []jsonOperationResult{
746 newJSONOperationResult(restoreStatusRestored, restoreKindFile, restoreInput{Path: "/Reports/old.pdf", Revision: "015f"}, file),
747 }, nil),
748 "revs": newJSONOperationOutput(revsInput{Path: "/Reports/old.pdf", Long: true, Time: "server", TimeFormat: "2006-01-02"}, []jsonOperationResult{
749 newJSONOperationResult(revsJSONStatusRevision, file.Type, nil, file),
750 }, nil),
751 "rm": newJSONOperationOutput(nil, []jsonOperationResult{
752 newJSONOperationResult(removeJSONStatusDeleted, file.Type, removeInput{Path: "/Reports/old.pdf", Permanent: false, Recursive: false, Force: false}, file),
753 }, nil),
754 "search": newJSONOperationOutput(searchInput{Query: "report", Path: "/Reports", Long: true, Sort: "type", Reverse: false, Time: "server", TimeFormat: "2006-01-02"}, []jsonOperationResult{

Calls 11

sampleJSONFileMetadataFunction · 0.85
sampleJSONFolderMetadataFunction · 0.85
sampleTeamMemberJSONFunction · 0.85
newJSONOperationOutputFunction · 0.85
newJSONOperationResultFunction · 0.85
sampleJSONAccountFunction · 0.85
uint64PtrFunction · 0.85
jsonCommandManifestForFunction · 0.85

Tested by

no test coverage detected