dropbox_api 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +14 -0
- data/.rubocop_todo.yml +442 -0
- data/Gemfile +5 -1
- data/TODO.md +16 -7
- data/api_coverage.md +7 -7
- data/docs/DropboxApi.html +4 -4
- data/docs/DropboxApi/Authenticator.html +3 -3
- data/docs/DropboxApi/ChunkedUploader.html +3 -3
- data/docs/DropboxApi/Client.html +212 -26
- data/docs/DropboxApi/ConnectionBuilder.html +3 -3
- data/docs/DropboxApi/Endpoints.html +3 -3
- data/docs/DropboxApi/Endpoints/Auth.html +3 -3
- data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +3 -3
- data/docs/DropboxApi/Endpoints/Base.html +3 -3
- data/docs/DropboxApi/Endpoints/ContentDownload.html +3 -3
- data/docs/DropboxApi/Endpoints/ContentUpload.html +3 -3
- data/docs/DropboxApi/Endpoints/Files.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Copy.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/CopyReferenceGet.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/CopyReferenceSave.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/CreateFileRequest.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Delete.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Download.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/GetMetadata.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/GetPreview.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/GetTemporaryLink.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/GetThumbnail.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/GetThumbnailBatch.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/ListFolder.html +30 -11
- data/docs/DropboxApi/Endpoints/Files/ListFolderContinue.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/ListFolderGetLatestCursor.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/ListFolderLongpoll.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/ListRevisions.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Move.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/PermanentlyDelete.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Restore.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/SaveUrl.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/SaveUrlCheckJobStatus.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Search.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/Upload.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/UploadSessionAppendV2.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/UploadSessionFinish.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/UploadSessionStart.html +3 -3
- data/docs/DropboxApi/Endpoints/Rpc.html +4 -4
- data/docs/DropboxApi/Endpoints/RpcContent.html +3 -3
- data/docs/DropboxApi/Endpoints/RpcNotify.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing.html +5 -5
- data/docs/DropboxApi/Endpoints/Sharing/AddFileMember.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/AddFolderMember.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/CreateSharedLinkWithSettings.html +103 -12
- data/docs/DropboxApi/Endpoints/Sharing/GetSharedLinkMetadata.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/ListFileMembers.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/ListFolderMembers.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/ListSharedLinks.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/RevokeSharedLink.html +293 -0
- data/docs/DropboxApi/Endpoints/Sharing/ShareFolder.html +3 -3
- data/docs/DropboxApi/Endpoints/Sharing/UnshareFile.html +3 -3
- data/docs/DropboxApi/Endpoints/Users.html +3 -3
- data/docs/DropboxApi/Endpoints/Users/GetAccount.html +3 -3
- data/docs/DropboxApi/Endpoints/Users/GetAccountBatch.html +3 -3
- data/docs/DropboxApi/Endpoints/Users/GetCurrentAccount.html +3 -3
- data/docs/DropboxApi/Endpoints/Users/GetSpaceUsage.html +3 -3
- data/docs/DropboxApi/Errors.html +5 -5
- data/docs/DropboxApi/Errors/AddFileMemberError.html +3 -3
- data/docs/DropboxApi/Errors/AddFolderMemberError.html +3 -3
- data/docs/DropboxApi/Errors/AddMemberSelectorError.html +3 -3
- data/docs/DropboxApi/Errors/AlreadySharedError.html +3 -3
- data/docs/DropboxApi/Errors/BadPathError.html +3 -3
- data/docs/DropboxApi/Errors/BasicError.html +4 -4
- data/docs/DropboxApi/Errors/CantCopySharedFolderError.html +3 -3
- data/docs/DropboxApi/Errors/CantMoveFolderIntoItselfError.html +3 -3
- data/docs/DropboxApi/Errors/CantNestSharedFolderError.html +3 -3
- data/docs/DropboxApi/Errors/CantShareOutsideTeamError.html +3 -3
- data/docs/DropboxApi/Errors/ContainsSharedFolderError.html +3 -3
- data/docs/DropboxApi/Errors/ConversionError.html +3 -3
- data/docs/DropboxApi/Errors/CreateFileRequestError.html +3 -3
- data/docs/DropboxApi/Errors/CreateFolderError.html +3 -3
- data/docs/DropboxApi/Errors/CreateSharedLinkWithSettingsError.html +3 -3
- data/docs/DropboxApi/Errors/CursorClosedError.html +3 -3
- data/docs/DropboxApi/Errors/CursorNotClosedError.html +3 -3
- data/docs/DropboxApi/Errors/DeleteError.html +3 -3
- data/docs/DropboxApi/Errors/DisallowedNameError.html +3 -3
- data/docs/DropboxApi/Errors/DisallowedSharedLinkPolicyError.html +3 -3
- data/docs/DropboxApi/Errors/DownloadError.html +3 -3
- data/docs/DropboxApi/Errors/DownloadFailedError.html +3 -3
- data/docs/DropboxApi/Errors/EmailUnverifiedError.html +3 -3
- data/docs/DropboxApi/Errors/FileAncestorConflictError.html +3 -3
- data/docs/DropboxApi/Errors/FileConflictError.html +3 -3
- data/docs/DropboxApi/Errors/FileMemberActionError.html +3 -3
- data/docs/DropboxApi/Errors/FolderConflictError.html +3 -3
- data/docs/DropboxApi/Errors/GetAccountError.html +3 -3
- data/docs/DropboxApi/Errors/GetCopyReferenceError.html +3 -3
- data/docs/DropboxApi/Errors/GetMetadataError.html +3 -3
- data/docs/DropboxApi/Errors/GroupDeletedError.html +3 -3
- data/docs/DropboxApi/Errors/GroupNotOnTeamError.html +3 -3
- data/docs/DropboxApi/Errors/HttpError.html +3 -3
- data/docs/DropboxApi/Errors/InProgressError.html +3 -3
- data/docs/DropboxApi/Errors/InsideAppFolderError.html +3 -3
- data/docs/DropboxApi/Errors/InsideOsxPackageError.html +3 -3
- data/docs/DropboxApi/Errors/InsidePublicFolderError.html +3 -3
- data/docs/DropboxApi/Errors/InsideSharedFolderError.html +3 -3
- data/docs/DropboxApi/Errors/InsufficientPlanError.html +3 -3
- data/docs/DropboxApi/Errors/InsufficientSpaceError.html +3 -3
- data/docs/DropboxApi/Errors/InternalError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidCommentError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidCopyReferenceError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidCursorError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidDropboxIdError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidEmailError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidFileError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidIdError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidMemberError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidPathError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidRevisionError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidSettingsError.html +3 -3
- data/docs/DropboxApi/Errors/InvalidUrlError.html +3 -3
- data/docs/DropboxApi/Errors/IsAppFolderError.html +3 -3
- data/docs/DropboxApi/Errors/IsFileError.html +3 -3
- data/docs/DropboxApi/Errors/IsFolderError.html +3 -3
- data/docs/DropboxApi/Errors/IsOsxPackageError.html +3 -3
- data/docs/DropboxApi/Errors/IsPublicFolderError.html +3 -3
- data/docs/DropboxApi/Errors/ListFolderContinueError.html +3 -3
- data/docs/DropboxApi/Errors/ListFolderError.html +3 -3
- data/docs/DropboxApi/Errors/ListFolderLongpollError.html +3 -3
- data/docs/DropboxApi/Errors/ListRevisionsError.html +3 -3
- data/docs/DropboxApi/Errors/ListSharedLinksError.html +3 -3
- data/docs/DropboxApi/Errors/LookupError.html +3 -3
- data/docs/DropboxApi/Errors/MalformedPathError.html +3 -3
- data/docs/DropboxApi/Errors/NoAccountError.html +3 -3
- data/docs/DropboxApi/Errors/NoPermissionError.html +3 -3
- data/docs/DropboxApi/Errors/NoWritePermissionError.html +3 -3
- data/docs/DropboxApi/Errors/NotAMemberError.html +3 -3
- data/docs/DropboxApi/Errors/NotFileError.html +3 -3
- data/docs/DropboxApi/Errors/NotFolderError.html +3 -3
- data/docs/DropboxApi/Errors/NotFoundError.html +3 -3
- data/docs/DropboxApi/Errors/PollError.html +3 -3
- data/docs/DropboxApi/Errors/PreviewError.html +3 -3
- data/docs/DropboxApi/Errors/RateLimitError.html +3 -3
- data/docs/DropboxApi/Errors/RelocationError.html +3 -3
- data/docs/DropboxApi/Errors/RestoreError.html +3 -3
- data/docs/DropboxApi/Errors/RestrictedContentError.html +3 -3
- data/docs/DropboxApi/Errors/RevokeSharedLinkError.html +164 -0
- data/docs/DropboxApi/Errors/SaveCopyReferenceError.html +3 -3
- data/docs/DropboxApi/Errors/SaveUrlError.html +3 -3
- data/docs/DropboxApi/Errors/SearchError.html +3 -3
- data/docs/DropboxApi/Errors/SettingsError.html +3 -3
- data/docs/DropboxApi/Errors/ShareFolderError.html +3 -3
- data/docs/DropboxApi/Errors/SharePathError.html +3 -3
- data/docs/DropboxApi/Errors/SharedFolderAccessError.html +3 -3
- data/docs/DropboxApi/Errors/SharedLinkAccessDeniedError.html +3 -3
- data/docs/DropboxApi/Errors/SharedLinkAlreadyExistsError.html +3 -3
- data/docs/DropboxApi/Errors/SharedLinkError.html +3 -3
- data/docs/DropboxApi/Errors/SharedLinkMalformedError.html +143 -0
- data/docs/DropboxApi/Errors/SharedLinkNotFoundError.html +3 -3
- data/docs/DropboxApi/Errors/SharingFileAccessError.html +3 -3
- data/docs/DropboxApi/Errors/SharingUserError.html +3 -3
- data/docs/DropboxApi/Errors/TeamFolderError.html +3 -3
- data/docs/DropboxApi/Errors/TeamPolicyDisallowsMemberPolicyError.html +3 -3
- data/docs/DropboxApi/Errors/ThumbnailBatchError.html +3 -3
- data/docs/DropboxApi/Errors/ThumbnailError.html +3 -3
- data/docs/DropboxApi/Errors/TooManyFilesError.html +3 -3
- data/docs/DropboxApi/Errors/TooManyMembersError.html +3 -3
- data/docs/DropboxApi/Errors/TooManyPendingInvitesError.html +3 -3
- data/docs/DropboxApi/Errors/TooManyRequestsError.html +3 -3
- data/docs/DropboxApi/Errors/TooManySharedFolderTargetsError.html +3 -3
- data/docs/DropboxApi/Errors/TooManyWriteOperationsError.html +3 -3
- data/docs/DropboxApi/Errors/UnmountedError.html +3 -3
- data/docs/DropboxApi/Errors/UnshareFileError.html +3 -3
- data/docs/DropboxApi/Errors/UnsupportedContentError.html +3 -3
- data/docs/DropboxApi/Errors/UnsupportedExtensionError.html +3 -3
- data/docs/DropboxApi/Errors/UnsupportedImageError.html +3 -3
- data/docs/DropboxApi/Errors/UnsupportedLinkTypeError.html +3 -3
- data/docs/DropboxApi/Errors/UnverifiedDropboxId.html +3 -3
- data/docs/DropboxApi/Errors/UploadError.html +3 -3
- data/docs/DropboxApi/Errors/UploadSessionFinishError.html +3 -3
- data/docs/DropboxApi/Errors/UploadSessionLookupError.html +3 -3
- data/docs/DropboxApi/Errors/UploadSessionOffsetError.html +3 -3
- data/docs/DropboxApi/Errors/UploadWriteFailedError.html +3 -3
- data/docs/DropboxApi/Errors/WriteConflictError.html +3 -3
- data/docs/DropboxApi/Errors/WriteError.html +3 -3
- data/docs/DropboxApi/Metadata.html +3 -3
- data/docs/DropboxApi/Metadata/AccessLevel.html +3 -3
- data/docs/DropboxApi/Metadata/AddFileMemberResult.html +3 -3
- data/docs/DropboxApi/Metadata/AddMember.html +3 -3
- data/docs/DropboxApi/Metadata/Base.html +3 -3
- data/docs/DropboxApi/Metadata/BasicAccount.html +3 -3
- data/docs/DropboxApi/Metadata/CommitInfo.html +3 -3
- data/docs/DropboxApi/Metadata/Deleted.html +3 -3
- data/docs/DropboxApi/Metadata/Dimensions.html +3 -3
- data/docs/DropboxApi/Metadata/Field.html +3 -3
- data/docs/DropboxApi/Metadata/File.html +3 -3
- data/docs/DropboxApi/Metadata/FileLinkMetadata.html +3 -3
- data/docs/DropboxApi/Metadata/FileMemberAction.html +3 -3
- data/docs/DropboxApi/Metadata/FileRequest.html +3 -3
- data/docs/DropboxApi/Metadata/Folder.html +3 -3
- data/docs/DropboxApi/Metadata/FolderLinkMetadata.html +3 -3
- data/docs/DropboxApi/Metadata/FolderSharingInfo.html +3 -3
- data/docs/DropboxApi/Metadata/LinkPermissions.html +3 -3
- data/docs/DropboxApi/Metadata/Location.html +3 -3
- data/docs/DropboxApi/Metadata/MediaInfo.html +3 -3
- data/docs/DropboxApi/Metadata/MediaMetadata.html +3 -3
- data/docs/DropboxApi/Metadata/Member.html +3 -3
- data/docs/DropboxApi/Metadata/MemberAction.html +3 -3
- data/docs/DropboxApi/Metadata/MemberActionList.html +3 -3
- data/docs/DropboxApi/Metadata/MemberPermission.html +3 -3
- data/docs/DropboxApi/Metadata/MemberPermissionList.html +3 -3
- data/docs/DropboxApi/Metadata/Name.html +3 -3
- data/docs/DropboxApi/Metadata/ParentFolderAccessInfo.html +3 -3
- data/docs/DropboxApi/Metadata/PhotoMetadata.html +3 -3
- data/docs/DropboxApi/Metadata/Resource.html +3 -3
- data/docs/DropboxApi/Metadata/SharedFolder.html +3 -3
- data/docs/DropboxApi/Metadata/SharedFolderPolicy.html +3 -3
- data/docs/DropboxApi/Metadata/SharedLink.html +3 -3
- data/docs/DropboxApi/Metadata/SharedLinkMetadata.html +3 -3
- data/docs/DropboxApi/Metadata/SpaceAllocation.html +3 -3
- data/docs/DropboxApi/Metadata/SpaceUsage.html +3 -3
- data/docs/DropboxApi/Metadata/Tag.html +3 -3
- data/docs/DropboxApi/Metadata/Team.html +3 -3
- data/docs/DropboxApi/Metadata/TeamMemberInfo.html +3 -3
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultData.html +3 -3
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultEntry.html +3 -3
- data/docs/DropboxApi/Metadata/UploadSessionCursor.html +3 -3
- data/docs/DropboxApi/Metadata/VideoMetadata.html +3 -3
- data/docs/DropboxApi/Metadata/WriteMode.html +3 -3
- data/docs/DropboxApi/MiddleWare.html +3 -3
- data/docs/DropboxApi/MiddleWare/DecodeResult.html +3 -3
- data/docs/DropboxApi/MiddleWare/Stack.html +3 -3
- data/docs/DropboxApi/OptionsValidator.html +4 -4
- data/docs/DropboxApi/ResultBuilder.html +3 -3
- data/docs/DropboxApi/Results.html +3 -3
- data/docs/DropboxApi/Results/AddFileMemberResultList.html +3 -3
- data/docs/DropboxApi/Results/Base.html +3 -3
- data/docs/DropboxApi/Results/BasicAccountBatch.html +3 -3
- data/docs/DropboxApi/Results/GetCopyReferenceResult.html +3 -3
- data/docs/DropboxApi/Results/GetTemporaryLinkResult.html +3 -3
- data/docs/DropboxApi/Results/GetThumbnailBatchResult.html +3 -3
- data/docs/DropboxApi/Results/ListFolderGetLatestCursorResult.html +3 -3
- data/docs/DropboxApi/Results/ListFolderLongpollResult.html +3 -3
- data/docs/DropboxApi/Results/ListFolderResult.html +3 -3
- data/docs/DropboxApi/Results/ListRevisionsResult.html +3 -3
- data/docs/DropboxApi/Results/ListSharedLinksResult.html +3 -3
- data/docs/DropboxApi/Results/SaveCopyReferenceResult.html +3 -3
- data/docs/DropboxApi/Results/SaveUrlJobStatus.html +3 -3
- data/docs/DropboxApi/Results/SaveUrlResult.html +3 -3
- data/docs/DropboxApi/Results/Search.html +3 -3
- data/docs/DropboxApi/Results/Search/Match.html +3 -3
- data/docs/DropboxApi/Results/SearchResult.html +3 -3
- data/docs/DropboxApi/Results/ShareFolderLaunch.html +3 -3
- data/docs/DropboxApi/Results/SharedFileMembers.html +3 -3
- data/docs/DropboxApi/Results/SharedFolderMembers.html +3 -3
- data/docs/DropboxApi/Results/UploadSessionStart.html +3 -3
- data/docs/DropboxApi/Results/VoidResult.html +3 -3
- data/docs/DropboxScaffoldBuilder.html +3 -3
- data/docs/_index.html +29 -8
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +3 -3
- data/docs/file.api_coverage.html +3 -3
- data/docs/file.rails_setup.html +3 -3
- data/docs/frames.html +1 -1
- data/docs/index.html +3 -3
- data/docs/method_list.html +230 -214
- data/docs/top-level-namespace.html +3 -3
- data/dropbox_api.gemspec +1 -3
- data/lib/dropbox_api.rb +16 -1
- data/lib/dropbox_api/endpoints/base.rb +3 -1
- data/lib/dropbox_api/endpoints/file_requests/create_file_request.rb +2 -2
- data/lib/dropbox_api/endpoints/files/copy_batch.rb +35 -0
- data/lib/dropbox_api/endpoints/files/copy_batch_check.rb +20 -0
- data/lib/dropbox_api/endpoints/files/create_folder_batch.rb +40 -0
- data/lib/dropbox_api/endpoints/files/create_folder_batch_check.rb +21 -0
- data/lib/dropbox_api/endpoints/files/delete_batch.rb +22 -0
- data/lib/dropbox_api/endpoints/files/delete_batch_check.rb +20 -0
- data/lib/dropbox_api/endpoints/files/upload.rb +1 -1
- data/lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb +1 -1
- data/lib/dropbox_api/errors/create_folder_batch_error.rb +7 -0
- data/lib/dropbox_api/errors/delete_error.rb +3 -2
- data/lib/dropbox_api/errors/relocation_batch_entry_error.rb +9 -0
- data/lib/dropbox_api/results/copy_batch_result.rb +14 -0
- data/lib/dropbox_api/results/create_folder_batch_result.rb +20 -0
- data/lib/dropbox_api/results/create_folder_batch_result_entry.rb +19 -0
- data/lib/dropbox_api/results/delete_batch_result.rb +20 -0
- data/lib/dropbox_api/results/delete_batch_result_entry.rb +15 -0
- data/lib/dropbox_api/results/relocation_batch_result.rb +20 -0
- data/lib/dropbox_api/results/relocation_batch_result_entry.rb +15 -0
- data/lib/dropbox_api/version.rb +1 -1
- data/yardoc/rspec.rb +5 -5
- metadata +37 -18
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Top Level Namespace
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.9.
|
|
9
|
+
— Documentation by YARD 0.9.16
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
<div id="footer">
|
|
105
|
-
Generated on
|
|
105
|
+
Generated on Sat Feb 16 18:39:17 2019 by
|
|
106
106
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
107
|
-
0.9.
|
|
107
|
+
0.9.16 (ruby-2.3.3).
|
|
108
108
|
</div>
|
|
109
109
|
|
|
110
110
|
</div>
|
data/dropbox_api.gemspec
CHANGED
|
@@ -17,14 +17,12 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
spec.has_rdoc = "yard"
|
|
21
|
-
|
|
22
20
|
spec.add_development_dependency "bundler", ">= 1.7"
|
|
23
21
|
spec.add_development_dependency "rake", "~> 10.0"
|
|
24
22
|
spec.add_development_dependency "rspec"
|
|
25
23
|
spec.add_development_dependency "vcr"
|
|
26
24
|
spec.add_development_dependency "webmock"
|
|
27
25
|
|
|
28
|
-
spec.add_dependency "oauth2", "~> 1.1"
|
|
29
26
|
spec.add_dependency "faraday", ">= 0.8", "<= 0.15.4"
|
|
27
|
+
spec.add_dependency "oauth2", "~> 1.1"
|
|
30
28
|
end
|
data/lib/dropbox_api.rb
CHANGED
|
@@ -71,9 +71,9 @@ require 'dropbox_api/errors/share_path_error'
|
|
|
71
71
|
require 'dropbox_api/errors/share_folder_error'
|
|
72
72
|
require 'dropbox_api/errors/get_copy_reference_error'
|
|
73
73
|
require 'dropbox_api/errors/save_copy_reference_error'
|
|
74
|
+
require 'dropbox_api/errors/create_folder_batch_error'
|
|
74
75
|
require 'dropbox_api/errors/create_folder_error'
|
|
75
76
|
require 'dropbox_api/errors/create_shared_link_with_settings_error'
|
|
76
|
-
require 'dropbox_api/errors/delete_error'
|
|
77
77
|
require 'dropbox_api/errors/download_error'
|
|
78
78
|
require 'dropbox_api/errors/sharing_file_access_error'
|
|
79
79
|
require 'dropbox_api/errors/sharing_user_error'
|
|
@@ -98,14 +98,21 @@ require 'dropbox_api/errors/poll_error'
|
|
|
98
98
|
require 'dropbox_api/errors/add_file_member_error'
|
|
99
99
|
require 'dropbox_api/errors/add_folder_member_error'
|
|
100
100
|
require 'dropbox_api/errors/too_many_requests_error'
|
|
101
|
+
require 'dropbox_api/errors/relocation_batch_entry_error'
|
|
101
102
|
require 'dropbox_api/errors/get_account_error'
|
|
102
103
|
require 'dropbox_api/errors/thumbnail_batch_error'
|
|
103
104
|
require 'dropbox_api/errors/thumbnail_error'
|
|
104
105
|
require 'dropbox_api/errors/create_file_request_error'
|
|
106
|
+
require 'dropbox_api/errors/delete_error'
|
|
105
107
|
|
|
106
108
|
require 'dropbox_api/result_builder'
|
|
107
109
|
require 'dropbox_api/results/base'
|
|
108
110
|
require 'dropbox_api/results/basic_account_batch'
|
|
111
|
+
require 'dropbox_api/results/create_folder_batch_result'
|
|
112
|
+
require 'dropbox_api/results/create_folder_batch_result_entry'
|
|
113
|
+
require 'dropbox_api/results/relocation_batch_result'
|
|
114
|
+
require 'dropbox_api/results/relocation_batch_result_entry'
|
|
115
|
+
require 'dropbox_api/results/copy_batch_result'
|
|
109
116
|
require 'dropbox_api/results/get_copy_reference_result'
|
|
110
117
|
require 'dropbox_api/results/save_copy_reference_result'
|
|
111
118
|
require 'dropbox_api/results/add_file_member_result_list'
|
|
@@ -125,6 +132,8 @@ require 'dropbox_api/results/shared_file_members'
|
|
|
125
132
|
require 'dropbox_api/results/shared_folder_members'
|
|
126
133
|
require 'dropbox_api/results/void_result'
|
|
127
134
|
require 'dropbox_api/results/upload_session_start'
|
|
135
|
+
require 'dropbox_api/results/delete_batch_result_entry'
|
|
136
|
+
require 'dropbox_api/results/delete_batch_result'
|
|
128
137
|
|
|
129
138
|
require 'dropbox_api/client'
|
|
130
139
|
require 'dropbox_api/connection_builder'
|
|
@@ -140,9 +149,12 @@ require 'dropbox_api/endpoints/content_upload'
|
|
|
140
149
|
require 'dropbox_api/endpoints/auth/token_revoke'
|
|
141
150
|
|
|
142
151
|
require 'dropbox_api/endpoints/files/copy'
|
|
152
|
+
require 'dropbox_api/endpoints/files/copy_batch_check'
|
|
153
|
+
require 'dropbox_api/endpoints/files/copy_batch'
|
|
143
154
|
require 'dropbox_api/endpoints/files/copy_reference_get'
|
|
144
155
|
require 'dropbox_api/endpoints/files/copy_reference_save'
|
|
145
156
|
require 'dropbox_api/endpoints/files/create_folder'
|
|
157
|
+
require 'dropbox_api/endpoints/files/create_folder_batch'
|
|
146
158
|
require 'dropbox_api/endpoints/files/delete'
|
|
147
159
|
require 'dropbox_api/endpoints/files/download'
|
|
148
160
|
require 'dropbox_api/endpoints/files/get_metadata'
|
|
@@ -165,6 +177,9 @@ require 'dropbox_api/endpoints/files/upload'
|
|
|
165
177
|
require 'dropbox_api/endpoints/files/upload_session_start'
|
|
166
178
|
require 'dropbox_api/endpoints/files/upload_session_append_v2'
|
|
167
179
|
require 'dropbox_api/endpoints/files/upload_session_finish'
|
|
180
|
+
require 'dropbox_api/endpoints/files/delete_batch_check'
|
|
181
|
+
require 'dropbox_api/endpoints/files/delete_batch'
|
|
182
|
+
require 'dropbox_api/endpoints/files/create_folder_batch_check'
|
|
168
183
|
|
|
169
184
|
require 'dropbox_api/endpoints/sharing/add_file_member'
|
|
170
185
|
require 'dropbox_api/endpoints/sharing/list_file_members'
|
|
@@ -13,8 +13,8 @@ module DropboxApi::Endpoints::Files
|
|
|
13
13
|
# this will be relative to the app folder.
|
|
14
14
|
add_endpoint :create_file_request do |title, destination|
|
|
15
15
|
perform_request({
|
|
16
|
-
title
|
|
17
|
-
destination
|
|
16
|
+
:title => title,
|
|
17
|
+
:destination => destination
|
|
18
18
|
})
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
|
2
|
+
class CopyBatch < DropboxApi::Endpoints::Rpc
|
|
3
|
+
Method = :post
|
|
4
|
+
Path = "/2/files/copy_batch_v2".freeze
|
|
5
|
+
ResultType = DropboxApi::Results::CopyBatchResult
|
|
6
|
+
|
|
7
|
+
include DropboxApi::OptionsValidator
|
|
8
|
+
|
|
9
|
+
# Copy multiple files or folders to different locations at once in the
|
|
10
|
+
# user's Dropbox.
|
|
11
|
+
#
|
|
12
|
+
# This will either finish synchronously, or return a job ID and do
|
|
13
|
+
# the async copy job in background. Please use {Client#copy_batch_check}
|
|
14
|
+
# to check the job status.
|
|
15
|
+
#
|
|
16
|
+
# Note: No errors are returned by this endpoint.
|
|
17
|
+
#
|
|
18
|
+
# @param entries [Array<Hash>] List of entries to be moved or copied.
|
|
19
|
+
# Each entry must be a hash with two keys: `:from_path` & `:to_path`.
|
|
20
|
+
# @option options autorename [Boolean] If there's a conflict with any file,
|
|
21
|
+
# have the Dropbox server try to autorename that file to avoid the
|
|
22
|
+
# conflict. The default for this field is `false`.
|
|
23
|
+
# @return [String, Array] Either the job id or the list of job statuses.
|
|
24
|
+
add_endpoint :copy_batch do |entries, options = {}|
|
|
25
|
+
validate_options([
|
|
26
|
+
:autorename
|
|
27
|
+
], options)
|
|
28
|
+
options[:autorename] ||= false
|
|
29
|
+
|
|
30
|
+
perform_request(options.merge({
|
|
31
|
+
:entries => entries
|
|
32
|
+
}))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
|
2
|
+
class CopyBatchCheck < DropboxApi::Endpoints::Rpc
|
|
3
|
+
Method = :post
|
|
4
|
+
Path = '/2/files/copy_batch/check_v2'.freeze
|
|
5
|
+
ResultType = DropboxApi::Results::RelocationBatchResult
|
|
6
|
+
ErrorType = DropboxApi::Errors::PollError
|
|
7
|
+
|
|
8
|
+
# Returns the status of an asynchronous job for {Client#copy_batch}. It
|
|
9
|
+
# returns a list of results for each entry.
|
|
10
|
+
#
|
|
11
|
+
# @param async_job_id [String] Id of the asynchronous job.
|
|
12
|
+
# This is the value of a response returned from the method that
|
|
13
|
+
# launched the job.
|
|
14
|
+
# @return [:in_progress, Array] This could be either the `:in_progress`
|
|
15
|
+
# flag or a list of job statuses.
|
|
16
|
+
add_endpoint :copy_batch_check do |async_job_id|
|
|
17
|
+
perform_request :async_job_id => async_job_id
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
|
2
|
+
class CreateFolderBatch < DropboxApi::Endpoints::Rpc
|
|
3
|
+
Method = :post
|
|
4
|
+
Path = "/2/files/create_folder_batch".freeze
|
|
5
|
+
ResultType = DropboxApi::Results::CreateFolderBatchResult
|
|
6
|
+
|
|
7
|
+
include DropboxApi::OptionsValidator
|
|
8
|
+
|
|
9
|
+
# Create multiple folders at once.
|
|
10
|
+
#
|
|
11
|
+
# This route is asynchronous for large batches, which returns a job ID
|
|
12
|
+
# immediately and runs the create folder batch asynchronously. Otherwise,
|
|
13
|
+
# creates the folders and returns the result synchronously for smaller
|
|
14
|
+
# inputs. You can force asynchronous behaviour by using the `:force_async`
|
|
15
|
+
# flag. Use {Client#create_folder_batch_check} to check the job status.
|
|
16
|
+
#
|
|
17
|
+
# Note: No errors are returned by this endpoint.
|
|
18
|
+
#
|
|
19
|
+
# @param paths [Array] List of paths to be created in the user's Dropbox.
|
|
20
|
+
# Duplicate path arguments in the batch are considered only once.
|
|
21
|
+
# @option options autorename [Boolean] If there's a conflict, have the
|
|
22
|
+
# Dropbox server try to autorename the folder to avoid the conflict.
|
|
23
|
+
# The default for this field is `false`.
|
|
24
|
+
# @option options force_async [Boolean] Whether to force the create to
|
|
25
|
+
# happen asynchronously. The default for this field is `false`.
|
|
26
|
+
# @return [String, Array] Either the job id or the list of job statuses.
|
|
27
|
+
add_endpoint :create_folder_batch do |paths, options = {}|
|
|
28
|
+
validate_options([
|
|
29
|
+
:autorename,
|
|
30
|
+
:force_async
|
|
31
|
+
], options)
|
|
32
|
+
options[:autorename] ||= false
|
|
33
|
+
options[:force_async] ||= false
|
|
34
|
+
|
|
35
|
+
perform_request(options.merge({
|
|
36
|
+
:paths => paths
|
|
37
|
+
}))
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
|
2
|
+
class CreateFolderBatchCheck < DropboxApi::Endpoints::Rpc
|
|
3
|
+
Method = :post
|
|
4
|
+
Path = "/2/files/create_folder_batch/check".freeze
|
|
5
|
+
ResultType = DropboxApi::Results::CreateFolderBatchResult
|
|
6
|
+
ErrorType = DropboxApi::Errors::PollError
|
|
7
|
+
|
|
8
|
+
# Returns the status of an asynchronous job for create_folder_batch.
|
|
9
|
+
# If success, it returns list of result for each entry.
|
|
10
|
+
#
|
|
11
|
+
# @param async_job_id [String] Id of the asynchronous job.
|
|
12
|
+
# This is the value of a response returned from the method that launched
|
|
13
|
+
# the job.
|
|
14
|
+
# @return [Array] A list of one result for each entry.
|
|
15
|
+
add_endpoint :create_folder_batch_check do |async_job_id|
|
|
16
|
+
perform_request({
|
|
17
|
+
:async_job_id => async_job_id
|
|
18
|
+
})
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
|
2
|
+
class DeleteBatch < DropboxApi::Endpoints::Rpc
|
|
3
|
+
Method = :post
|
|
4
|
+
Path = "/2/files/delete_batch".freeze
|
|
5
|
+
ResultType = DropboxApi::Results::DeleteBatchResult
|
|
6
|
+
|
|
7
|
+
# Delete multiple files/folders at once.
|
|
8
|
+
#
|
|
9
|
+
# This route is asynchronous, which returns a job ID immediately and runs
|
|
10
|
+
# the delete batch asynchronously. Use {Client#delete_batch_check} to check
|
|
11
|
+
# the job status.
|
|
12
|
+
#
|
|
13
|
+
# @param entries [Array] List of entries, each entry is a Hash with these
|
|
14
|
+
# fields: `path` (mandatory) & parent_rev (optional).
|
|
15
|
+
# @return [String, Array] Either the job id or the list of job statuses.
|
|
16
|
+
add_endpoint :delete_batch do |entries|
|
|
17
|
+
perform_request({
|
|
18
|
+
:entries => entries
|
|
19
|
+
})
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module DropboxApi::Endpoints::Files
|
|
2
|
+
class DeleteBatchCheck < DropboxApi::Endpoints::Rpc
|
|
3
|
+
Method = :post
|
|
4
|
+
Path = "/2/files/delete_batch/check".freeze
|
|
5
|
+
ResultType = DropboxApi::Results::DeleteBatchResult
|
|
6
|
+
ErrorType = DropboxApi::Errors::PollError
|
|
7
|
+
|
|
8
|
+
# Returns the status of an asynchronous job for delete_batch. If success,
|
|
9
|
+
# it returns list of result for each entry.
|
|
10
|
+
#
|
|
11
|
+
# @param async_job_id [String] Id of the asynchronous job.
|
|
12
|
+
# @return [:in_progress, Array] This could be either the `:in_progress`
|
|
13
|
+
# flag or a list of job statuses.
|
|
14
|
+
add_endpoint :delete_batch_check do |async_job_id|
|
|
15
|
+
perform_request({
|
|
16
|
+
:async_job_id => async_job_id
|
|
17
|
+
})
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -11,7 +11,7 @@ module DropboxApi::Endpoints::Files
|
|
|
11
11
|
#
|
|
12
12
|
# Do not use this to upload a file larger than 150 MB.
|
|
13
13
|
#
|
|
14
|
-
# For larger files you can use {#upload_by_chunks}.
|
|
14
|
+
# For larger files you can use {Client#upload_by_chunks}.
|
|
15
15
|
#
|
|
16
16
|
# @example
|
|
17
17
|
# client = DropboxApi::Client.new
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module DropboxApi::Results
|
|
2
|
+
class CopyBatchResult < DropboxApi::Results::Base
|
|
3
|
+
def self.new(result_data)
|
|
4
|
+
case result_data[".tag"]
|
|
5
|
+
when 'async_job_id'
|
|
6
|
+
result_data['async_job_id']
|
|
7
|
+
when 'complete'
|
|
8
|
+
RelocationBatchResult.new(result_data)
|
|
9
|
+
else
|
|
10
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module DropboxApi::Results
|
|
2
|
+
# Result returned by {Client#create_folder_batch} that may either launch an
|
|
3
|
+
# asynchronous job or complete synchronously.
|
|
4
|
+
#
|
|
5
|
+
# The value will be either a job id or a list of job statuses.
|
|
6
|
+
class CreateFolderBatchResult < DropboxApi::Results::Base
|
|
7
|
+
def self.new(result_data)
|
|
8
|
+
case result_data[".tag"]
|
|
9
|
+
when "async_job_id"
|
|
10
|
+
result_data
|
|
11
|
+
when "complete"
|
|
12
|
+
result_data["entries"].map do |entry|
|
|
13
|
+
DropboxApi::Results::CreateFolderBatchResultEntry.new(entry)
|
|
14
|
+
end
|
|
15
|
+
else
|
|
16
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module DropboxApi::Results
|
|
2
|
+
class CreateFolderBatchResultEntry < DropboxApi::Results::Base
|
|
3
|
+
def self.new(result_data)
|
|
4
|
+
case result_data['.tag']
|
|
5
|
+
when 'success'
|
|
6
|
+
DropboxApi::Metadata::Folder.new result_data['metadata']
|
|
7
|
+
when 'failure'
|
|
8
|
+
# At the moment, this is a `CreateFolderEntryError` which is an open
|
|
9
|
+
# union that can only be a `WriteError`. In the future, more errors
|
|
10
|
+
# could be added to the API which means we'd have to implement the
|
|
11
|
+
# actual `CreateFolderEntryError` class.
|
|
12
|
+
DropboxApi::Errors::WriteError
|
|
13
|
+
.build('Folder operation failed', result_data['failure']['path'])
|
|
14
|
+
else
|
|
15
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module DropboxApi::Results
|
|
2
|
+
# Result returned by {Client#delete_batch} that may either launch an
|
|
3
|
+
# asynchronous job or complete synchronously.
|
|
4
|
+
#
|
|
5
|
+
# The value will be either a job id or a list of job statuses.
|
|
6
|
+
class DeleteBatchResult < DropboxApi::Results::Base
|
|
7
|
+
def self.new(result_data)
|
|
8
|
+
case result_data[".tag"]
|
|
9
|
+
when "async_job_id"
|
|
10
|
+
result_data
|
|
11
|
+
when "complete"
|
|
12
|
+
result_data["entries"].map do |entry|
|
|
13
|
+
DropboxApi::Results::DeleteBatchResultEntry.new(entry)
|
|
14
|
+
end
|
|
15
|
+
else
|
|
16
|
+
raise NotImplementedError, "Unknown result type: #{result_data[".tag"]}"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module DropboxApi::Results
|
|
2
|
+
class DeleteBatchResultEntry < DropboxApi::Results::Base
|
|
3
|
+
def self.new(result_data)
|
|
4
|
+
case result_data['.tag']
|
|
5
|
+
when 'success'
|
|
6
|
+
DropboxApi::Metadata::Resource.new result_data['metadata']
|
|
7
|
+
when 'failure'
|
|
8
|
+
DropboxApi::Errors::DeleteError
|
|
9
|
+
.build('Delete operation failed', result_data['failure'])
|
|
10
|
+
else
|
|
11
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module DropboxApi::Results
|
|
2
|
+
# Result returned by {Client#copy_batch} or {Client#move_batch} that may
|
|
3
|
+
# either launch an asynchronous job or complete synchronously.
|
|
4
|
+
#
|
|
5
|
+
# The value will be either `:in_progress` or a list of job statuses.
|
|
6
|
+
class RelocationBatchResult < DropboxApi::Results::Base
|
|
7
|
+
def self.new(result_data)
|
|
8
|
+
case result_data[".tag"]
|
|
9
|
+
when "in_progress"
|
|
10
|
+
:in_progress
|
|
11
|
+
when "complete"
|
|
12
|
+
result_data["entries"].map do |entry|
|
|
13
|
+
DropboxApi::Results::RelocationBatchResultEntry.new(entry)
|
|
14
|
+
end
|
|
15
|
+
else
|
|
16
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|