dropbox_api 0.1.16 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +15 -0
- data/.travis.yml +0 -2
- data/Gemfile +6 -1
- data/README.md +7 -2
- data/Rakefile +4 -3
- data/TODO.md +16 -7
- data/api_coverage.md +8 -8
- data/bin/console +4 -3
- data/docs/DropboxApi/Authenticator.html +3 -3
- data/docs/DropboxApi/ChunkedUploader.html +3 -3
- data/docs/DropboxApi/Client.html +1541 -182
- data/docs/DropboxApi/ConnectionBuilder.html +3 -3
- data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +3 -3
- data/docs/DropboxApi/Endpoints/Auth.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/Copy.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/CopyBatch.html +359 -0
- data/docs/DropboxApi/Endpoints/Files/CopyBatchCheck.html +305 -0
- 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 +5 -5
- data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/CreateFolderBatch.html +377 -0
- data/docs/DropboxApi/Endpoints/Files/CreateFolderBatchCheck.html +308 -0
- data/docs/DropboxApi/Endpoints/Files/Delete.html +3 -3
- data/docs/DropboxApi/Endpoints/Files/DeleteBatch.html +305 -0
- data/docs/DropboxApi/Endpoints/Files/DeleteBatchCheck.html +307 -0
- 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 +4 -4
- 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/Files.html +5 -5
- 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/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/Sharing.html +5 -5
- 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/Endpoints/Users.html +3 -3
- data/docs/DropboxApi/Endpoints.html +3 -3
- 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/CreateFolderBatchError.html +161 -0
- 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 +5 -4
- 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/RelocationBatchEntryError.html +163 -0
- 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/Errors.html +5 -5
- 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/Metadata.html +3 -3
- data/docs/DropboxApi/MiddleWare/DecodeResult.html +3 -3
- data/docs/DropboxApi/MiddleWare/Stack.html +3 -3
- data/docs/DropboxApi/MiddleWare.html +3 -3
- data/docs/DropboxApi/OptionsValidator.html +4 -4
- data/docs/DropboxApi/ResultBuilder.html +3 -3
- data/docs/DropboxApi/Results/AddFileMemberResultList.html +3 -3
- data/docs/DropboxApi/Results/Base.html +4 -4
- data/docs/DropboxApi/Results/BasicAccountBatch.html +3 -3
- data/docs/DropboxApi/Results/CopyBatchResult.html +224 -0
- data/docs/DropboxApi/Results/CreateFolderBatchResult.html +241 -0
- data/docs/DropboxApi/Results/CreateFolderBatchResultEntry.html +234 -0
- data/docs/DropboxApi/Results/DeleteBatchResult.html +241 -0
- data/docs/DropboxApi/Results/DeleteBatchResultEntry.html +226 -0
- 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/RelocationBatchResult.html +241 -0
- data/docs/DropboxApi/Results/RelocationBatchResultEntry.html +226 -0
- 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/Match.html +3 -3
- data/docs/DropboxApi/Results/Search.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/DropboxApi/Results.html +5 -5
- data/docs/DropboxApi.html +4 -4
- data/docs/DropboxScaffoldBuilder.html +105 -50
- data/docs/_index.html +140 -14
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +3 -3
- data/docs/file.api_coverage.html +10 -10
- data/docs/file.rails_setup.html +3 -3
- data/docs/frames.html +1 -1
- data/docs/index.html +3 -3
- data/docs/js/app.js +11 -0
- data/docs/method_list.html +430 -254
- data/docs/top-level-namespace.html +3 -3
- data/dropbox_api.gemspec +15 -16
- data/lib/dropbox_api/authenticator.rb +3 -2
- data/lib/dropbox_api/chunked_uploader.rb +2 -1
- data/lib/dropbox_api/client.rb +2 -1
- data/lib/dropbox_api/connection_builder.rb +1 -0
- data/lib/dropbox_api/endpoints/auth/token_revoke.rb +2 -1
- data/lib/dropbox_api/endpoints/base.rb +7 -4
- data/lib/dropbox_api/endpoints/content_download.rb +4 -6
- data/lib/dropbox_api/endpoints/content_upload.rb +2 -1
- data/lib/dropbox_api/endpoints/file_requests/create_file_request.rb +2 -1
- data/lib/dropbox_api/endpoints/files/copy.rb +4 -3
- data/lib/dropbox_api/endpoints/files/copy_batch.rb +36 -0
- data/lib/dropbox_api/endpoints/files/copy_batch_check.rb +21 -0
- data/lib/dropbox_api/endpoints/files/copy_reference_get.rb +3 -2
- data/lib/dropbox_api/endpoints/files/copy_reference_save.rb +4 -3
- data/lib/dropbox_api/endpoints/files/create_folder.rb +3 -2
- data/lib/dropbox_api/endpoints/files/create_folder_batch.rb +41 -0
- data/lib/dropbox_api/endpoints/files/create_folder_batch_check.rb +22 -0
- data/lib/dropbox_api/endpoints/files/delete.rb +3 -2
- data/lib/dropbox_api/endpoints/files/delete_batch.rb +23 -0
- data/lib/dropbox_api/endpoints/files/delete_batch_check.rb +21 -0
- data/lib/dropbox_api/endpoints/files/download.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_metadata.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_preview.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_temporary_link.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_thumbnail.rb +3 -2
- data/lib/dropbox_api/endpoints/files/get_thumbnail_batch.rb +4 -3
- data/lib/dropbox_api/endpoints/files/list_folder.rb +3 -2
- data/lib/dropbox_api/endpoints/files/list_folder_continue.rb +3 -2
- data/lib/dropbox_api/endpoints/files/list_folder_get_latest_cursor.rb +2 -1
- data/lib/dropbox_api/endpoints/files/list_folder_longpoll.rb +3 -2
- data/lib/dropbox_api/endpoints/files/list_revisions.rb +3 -2
- data/lib/dropbox_api/endpoints/files/move.rb +4 -3
- data/lib/dropbox_api/endpoints/files/permanently_delete.rb +3 -2
- data/lib/dropbox_api/endpoints/files/restore.rb +4 -3
- data/lib/dropbox_api/endpoints/files/save_url.rb +4 -3
- data/lib/dropbox_api/endpoints/files/save_url_check_job_status.rb +3 -2
- data/lib/dropbox_api/endpoints/files/search.rb +16 -27
- data/lib/dropbox_api/endpoints/files/upload.rb +3 -2
- data/lib/dropbox_api/endpoints/files/upload_session_append_v2.rb +3 -2
- data/lib/dropbox_api/endpoints/files/upload_session_finish.rb +4 -3
- data/lib/dropbox_api/endpoints/files/upload_session_start.rb +4 -3
- data/lib/dropbox_api/endpoints/rpc.rb +2 -1
- data/lib/dropbox_api/endpoints/rpc_content.rb +2 -1
- data/lib/dropbox_api/endpoints/rpc_notify.rb +2 -1
- data/lib/dropbox_api/endpoints/sharing/add_file_member.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/add_folder_member.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/get_shared_link_metadata.rb +3 -2
- data/lib/dropbox_api/endpoints/sharing/list_file_members.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/list_folder_members.rb +4 -3
- data/lib/dropbox_api/endpoints/sharing/list_shared_links.rb +2 -1
- data/lib/dropbox_api/endpoints/sharing/revoke_shared_link.rb +3 -2
- data/lib/dropbox_api/endpoints/sharing/share_folder.rb +3 -2
- data/lib/dropbox_api/endpoints/sharing/unshare_file.rb +3 -2
- data/lib/dropbox_api/endpoints/users/get_account.rb +3 -2
- data/lib/dropbox_api/endpoints/users/get_account_batch.rb +3 -2
- data/lib/dropbox_api/endpoints/users/get_current_account.rb +2 -1
- data/lib/dropbox_api/endpoints/users/get_space_usage.rb +2 -1
- data/lib/dropbox_api/endpoints/virtual/upload_by_chunks.rb +1 -0
- data/lib/dropbox_api/errors/add_file_member_error.rb +5 -4
- data/lib/dropbox_api/errors/add_folder_member_error.rb +11 -10
- data/lib/dropbox_api/errors/add_member_selector_error.rb +6 -5
- data/lib/dropbox_api/errors/already_shared_error.rb +1 -0
- data/lib/dropbox_api/errors/basic_error.rb +2 -1
- data/lib/dropbox_api/errors/create_file_request_error.rb +1 -0
- data/lib/dropbox_api/errors/create_folder_batch_error.rb +8 -0
- data/lib/dropbox_api/errors/create_folder_error.rb +2 -1
- data/lib/dropbox_api/errors/create_shared_link_with_settings_error.rb +6 -5
- data/lib/dropbox_api/errors/delete_error.rb +5 -3
- data/lib/dropbox_api/errors/download_error.rb +2 -1
- data/lib/dropbox_api/errors/file_member_action_error.rb +5 -4
- data/lib/dropbox_api/errors/get_account_error.rb +2 -1
- data/lib/dropbox_api/errors/get_copy_reference_error.rb +2 -1
- data/lib/dropbox_api/errors/get_metadata_error.rb +2 -1
- data/lib/dropbox_api/errors/http_error.rb +1 -0
- data/lib/dropbox_api/errors/list_folder_continue_error.rb +3 -2
- data/lib/dropbox_api/errors/list_folder_error.rb +2 -1
- data/lib/dropbox_api/errors/list_folder_longpoll_error.rb +2 -1
- data/lib/dropbox_api/errors/list_revisions_error.rb +2 -1
- data/lib/dropbox_api/errors/list_shared_links_error.rb +3 -2
- data/lib/dropbox_api/errors/lookup_error.rb +6 -5
- data/lib/dropbox_api/errors/poll_error.rb +3 -2
- data/lib/dropbox_api/errors/preview_error.rb +5 -4
- data/lib/dropbox_api/errors/relocation_batch_entry_error.rb +10 -0
- data/lib/dropbox_api/errors/relocation_error.rb +8 -7
- data/lib/dropbox_api/errors/restore_error.rb +4 -3
- data/lib/dropbox_api/errors/revoke_shared_link_error.rb +5 -4
- data/lib/dropbox_api/errors/save_copy_reference_error.rb +6 -5
- data/lib/dropbox_api/errors/save_url_error.rb +5 -4
- data/lib/dropbox_api/errors/search_error.rb +2 -1
- data/lib/dropbox_api/errors/settings_error.rb +3 -2
- data/lib/dropbox_api/errors/share_folder_error.rb +6 -5
- data/lib/dropbox_api/errors/share_path_error.rb +12 -11
- data/lib/dropbox_api/errors/shared_folder_access_error.rb +5 -4
- data/lib/dropbox_api/errors/shared_link_error.rb +4 -3
- data/lib/dropbox_api/errors/sharing_file_access_error.rb +6 -5
- data/lib/dropbox_api/errors/sharing_user_error.rb +2 -1
- data/lib/dropbox_api/errors/thumbnail_batch_error.rb +2 -1
- data/lib/dropbox_api/errors/thumbnail_error.rb +5 -4
- data/lib/dropbox_api/errors/too_many_requests_error.rb +3 -2
- data/lib/dropbox_api/errors/unshare_file_error.rb +3 -2
- data/lib/dropbox_api/errors/upload_error.rb +2 -1
- data/lib/dropbox_api/errors/upload_session_finish_error.rb +4 -3
- data/lib/dropbox_api/errors/upload_session_lookup_error.rb +5 -4
- data/lib/dropbox_api/errors/upload_session_offset_error.rb +1 -0
- data/lib/dropbox_api/errors/upload_write_failed_error.rb +2 -1
- data/lib/dropbox_api/errors/write_conflict_error.rb +4 -3
- data/lib/dropbox_api/errors/write_error.rb +6 -5
- data/lib/dropbox_api/metadata/access_level.rb +1 -0
- data/lib/dropbox_api/metadata/add_file_member_result.rb +1 -0
- data/lib/dropbox_api/metadata/add_member.rb +3 -2
- data/lib/dropbox_api/metadata/base.rb +2 -1
- data/lib/dropbox_api/metadata/basic_account.rb +1 -0
- data/lib/dropbox_api/metadata/commit_info.rb +2 -1
- data/lib/dropbox_api/metadata/deleted.rb +1 -0
- data/lib/dropbox_api/metadata/dimensions.rb +1 -0
- data/lib/dropbox_api/metadata/field.rb +7 -4
- data/lib/dropbox_api/metadata/file.rb +2 -1
- data/lib/dropbox_api/metadata/file_categories_list.rb +9 -0
- data/lib/dropbox_api/metadata/file_category.rb +22 -0
- data/lib/dropbox_api/metadata/file_extensions_list.rb +13 -0
- data/lib/dropbox_api/metadata/file_link_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/file_member_action.rb +2 -1
- data/lib/dropbox_api/metadata/file_request.rb +1 -0
- data/lib/dropbox_api/metadata/file_status.rb +14 -0
- data/lib/dropbox_api/metadata/folder.rb +2 -1
- data/lib/dropbox_api/metadata/folder_link_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/folder_sharing_info.rb +1 -0
- data/lib/dropbox_api/metadata/link_permissions.rb +1 -0
- data/lib/dropbox_api/metadata/location.rb +1 -0
- data/lib/dropbox_api/metadata/media_info.rb +1 -0
- data/lib/dropbox_api/metadata/media_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/member.rb +6 -5
- data/lib/dropbox_api/metadata/member_action.rb +1 -0
- data/lib/dropbox_api/metadata/member_action_list.rb +1 -0
- data/lib/dropbox_api/metadata/member_permission.rb +1 -0
- data/lib/dropbox_api/metadata/member_permission_list.rb +1 -0
- data/lib/dropbox_api/metadata/metadata_v2.rb +7 -0
- data/lib/dropbox_api/metadata/name.rb +1 -0
- data/lib/dropbox_api/metadata/parent_folder_access_info.rb +1 -0
- data/lib/dropbox_api/metadata/photo_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/resource.rb +2 -1
- data/lib/dropbox_api/metadata/search_match_field_options.rb +9 -0
- data/lib/dropbox_api/metadata/search_match_type_v2.rb +16 -0
- data/lib/dropbox_api/metadata/search_match_v2.rb +18 -0
- data/lib/dropbox_api/metadata/search_options.rb +33 -0
- data/lib/dropbox_api/metadata/search_order_by.rb +14 -0
- data/lib/dropbox_api/metadata/shared_folder.rb +1 -0
- data/lib/dropbox_api/metadata/shared_folder_policy.rb +1 -0
- data/lib/dropbox_api/metadata/shared_link.rb +3 -2
- data/lib/dropbox_api/metadata/shared_link_metadata.rb +2 -1
- data/lib/dropbox_api/metadata/space_allocation.rb +1 -0
- data/lib/dropbox_api/metadata/space_usage.rb +1 -0
- data/lib/dropbox_api/metadata/tag.rb +2 -1
- data/lib/dropbox_api/metadata/team.rb +1 -0
- data/lib/dropbox_api/metadata/team_member_info.rb +1 -0
- data/lib/dropbox_api/metadata/thumbnail_batch_result_data.rb +1 -0
- data/lib/dropbox_api/metadata/thumbnail_batch_result_entry.rb +3 -2
- data/lib/dropbox_api/metadata/upload_session_cursor.rb +1 -0
- data/lib/dropbox_api/metadata/video_metadata.rb +1 -0
- data/lib/dropbox_api/metadata/write_mode.rb +6 -5
- data/lib/dropbox_api/middleware/decode_result.rb +3 -2
- data/lib/dropbox_api/middleware/stack.rb +1 -0
- data/lib/dropbox_api/options_validator.rb +1 -0
- data/lib/dropbox_api/result_builder.rb +3 -2
- data/lib/dropbox_api/results/add_file_member_result_list.rb +1 -0
- data/lib/dropbox_api/results/base.rb +1 -0
- data/lib/dropbox_api/results/basic_account_batch.rb +1 -0
- data/lib/dropbox_api/results/copy_batch_result.rb +15 -0
- data/lib/dropbox_api/results/create_folder_batch_result.rb +21 -0
- data/lib/dropbox_api/results/create_folder_batch_result_entry.rb +20 -0
- data/lib/dropbox_api/results/delete_batch_result.rb +21 -0
- data/lib/dropbox_api/results/delete_batch_result_entry.rb +16 -0
- data/lib/dropbox_api/results/get_copy_reference_result.rb +4 -3
- data/lib/dropbox_api/results/get_temporary_link_result.rb +3 -2
- data/lib/dropbox_api/results/get_thumbnail_batch_result.rb +2 -1
- data/lib/dropbox_api/results/list_folder_get_latest_cursor_result.rb +2 -1
- data/lib/dropbox_api/results/list_folder_longpoll_result.rb +3 -2
- data/lib/dropbox_api/results/list_folder_result.rb +4 -3
- data/lib/dropbox_api/results/list_revisions_result.rb +3 -2
- data/lib/dropbox_api/results/list_shared_links_result.rb +4 -3
- data/lib/dropbox_api/results/relocation_batch_result.rb +21 -0
- data/lib/dropbox_api/results/relocation_batch_result_entry.rb +16 -0
- data/lib/dropbox_api/results/save_copy_reference_result.rb +2 -1
- data/lib/dropbox_api/results/save_url_job_status.rb +7 -6
- data/lib/dropbox_api/results/save_url_result.rb +2 -1
- data/lib/dropbox_api/results/search/match.rb +3 -2
- data/lib/dropbox_api/results/search_v2_result.rb +24 -0
- data/lib/dropbox_api/results/share_folder_launch.rb +4 -3
- data/lib/dropbox_api/results/shared_file_members.rb +5 -4
- data/lib/dropbox_api/results/shared_folder_members.rb +5 -4
- data/lib/dropbox_api/results/upload_session_start.rb +2 -1
- data/lib/dropbox_api/results/void_result.rb +1 -0
- data/lib/dropbox_api/version.rb +2 -1
- data/lib/dropbox_api.rb +28 -3
- data/yardoc/endpoint_handler.rb +2 -1
- data/yardoc/helpers/html_helper.rb +2 -1
- data/yardoc/rspec.rb +3 -2
- data/yardoc/templates/default/method_details/setup.rb +1 -0
- metadata +64 -28
- data/CHANGES.md +0 -7
- data/lib/dropbox_api/results/search_result.rb +0 -22
@@ -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.19
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -102,9 +102,9 @@
|
|
102
102
|
</div>
|
103
103
|
|
104
104
|
<div id="footer">
|
105
|
-
Generated on Fri
|
105
|
+
Generated on Fri May 31 17:53:31 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.19 (ruby-2.6.2).
|
108
108
|
</div>
|
109
109
|
|
110
110
|
</div>
|
data/dropbox_api.gemspec
CHANGED
@@ -1,30 +1,29 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'dropbox_api/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
+
spec.name = 'dropbox_api'
|
8
9
|
spec.version = DropboxApi::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
10
|
+
spec.authors = ['Jesús Burgos']
|
11
|
+
spec.email = ['jburmac@gmail.com']
|
11
12
|
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.summary = 'Library for communicating with Dropbox API v2'
|
14
|
+
spec.homepage = 'https://github.com/Jesus/dropbox_api'
|
15
|
+
spec.license = 'MIT'
|
15
16
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
18
|
|
18
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
19
20
|
|
20
|
-
spec.
|
21
|
+
spec.add_development_dependency 'bundler', '>= 1.7'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'rspec'
|
24
|
+
spec.add_development_dependency 'vcr'
|
25
|
+
spec.add_development_dependency 'webmock'
|
21
26
|
|
22
|
-
spec.
|
23
|
-
spec.
|
24
|
-
spec.add_development_dependency "rspec"
|
25
|
-
spec.add_development_dependency "vcr"
|
26
|
-
spec.add_development_dependency "webmock"
|
27
|
-
|
28
|
-
spec.add_dependency "oauth2", "~> 1.1"
|
29
|
-
spec.add_dependency "faraday", ">= 0.8", "<= 0.15.4"
|
27
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
28
|
+
spec.add_dependency 'oauth2', '~> 1.1'
|
30
29
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'oauth2'
|
2
3
|
|
3
4
|
module DropboxApi
|
@@ -6,8 +7,8 @@ module DropboxApi
|
|
6
7
|
|
7
8
|
def initialize(client_id, client_secret)
|
8
9
|
@auth_code = OAuth2::Client.new(client_id, client_secret, {
|
9
|
-
:
|
10
|
-
:
|
10
|
+
authorize_url: 'https://www.dropbox.com/oauth2/authorize',
|
11
|
+
token_url: 'https://api.dropboxapi.com/oauth2/token'
|
11
12
|
}).auth_code
|
12
13
|
end
|
13
14
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi
|
2
3
|
class ChunkedUploader
|
3
4
|
include DropboxApi::OptionsValidator
|
@@ -13,7 +14,7 @@ module DropboxApi
|
|
13
14
|
|
14
15
|
def start
|
15
16
|
chunk = @i_stream.read @chunk_size
|
16
|
-
chunk =
|
17
|
+
chunk = '' if chunk.nil?
|
17
18
|
|
18
19
|
@cursor = @client.upload_session_start chunk
|
19
20
|
end
|
data/lib/dropbox_api/client.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Auth
|
2
3
|
class TokenRevoke < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/auth/token/revoke'
|
5
6
|
ResultType = DropboxApi::Results::VoidResult
|
6
7
|
ErrorType = nil
|
7
8
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints
|
2
3
|
class Base
|
3
4
|
def self.add_endpoint(name, &block)
|
@@ -25,16 +26,18 @@ module DropboxApi::Endpoints
|
|
25
26
|
build_result(raw_response.env[:api_result])
|
26
27
|
when 429
|
27
28
|
error = DropboxApi::Errors::TooManyRequestsError.build(
|
28
|
-
raw_response.env[:api_result][
|
29
|
-
raw_response.env[:api_result][
|
29
|
+
raw_response.env[:api_result]['error_summary'],
|
30
|
+
raw_response.env[:api_result]['error']['reason']
|
30
31
|
)
|
31
32
|
|
32
|
-
error.retry_after = raw_response.headers[
|
33
|
+
error.retry_after = raw_response.headers['retry-after'].to_i
|
33
34
|
|
34
35
|
raise error
|
35
36
|
else
|
36
|
-
raise
|
37
|
+
raise(
|
38
|
+
DropboxApi::Errors::HttpError,
|
37
39
|
"HTTP #{raw_response.status}: #{raw_response.body}"
|
40
|
+
)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints
|
2
3
|
class ContentDownload < DropboxApi::Endpoints::Base
|
3
4
|
def initialize(builder)
|
4
|
-
@connection = builder.build(
|
5
|
+
@connection = builder.build('https://content.dropboxapi.com') do |c|
|
5
6
|
c.response :decode_result
|
6
7
|
end
|
7
8
|
end
|
@@ -20,14 +21,11 @@ module DropboxApi::Endpoints
|
|
20
21
|
response = get_response(params)
|
21
22
|
api_result = process_response response
|
22
23
|
|
23
|
-
#
|
24
|
-
#
|
24
|
+
# We just yield the whole response to the block, it'd be nice in the
|
25
|
+
# future to support an interface that streams the response in chunks.
|
25
26
|
yield response.body if block_given?
|
26
27
|
|
27
28
|
api_result
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
31
|
-
# TODO:
|
32
|
-
# 1. Combine ContentDownload and ContentUpload to share its initialize method.
|
33
|
-
# 2. Reorganize the methods which create the request.
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints
|
2
3
|
class ContentUpload < DropboxApi::Endpoints::Base
|
3
4
|
def initialize(builder)
|
4
|
-
@connection = builder.build(
|
5
|
+
@connection = builder.build('https://content.dropboxapi.com') do |c|
|
5
6
|
c.response :decode_result
|
6
7
|
end
|
7
8
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class CreateFileRequest < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/file_requests/create'
|
5
6
|
ResultType = DropboxApi::Metadata::FileRequest
|
6
7
|
ErrorType = DropboxApi::Errors::CreateFileRequestError
|
7
8
|
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class Copy < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/copy'
|
5
6
|
ResultType = DropboxApi::Metadata::Resource
|
6
7
|
ErrorType = DropboxApi::Errors::RelocationError
|
7
8
|
|
@@ -13,8 +14,8 @@ module DropboxApi::Endpoints::Files
|
|
13
14
|
# @return The moved file.
|
14
15
|
add_endpoint :copy do |from, to|
|
15
16
|
perform_request({
|
16
|
-
:
|
17
|
-
:
|
17
|
+
from_path: from,
|
18
|
+
to_path: to
|
18
19
|
})
|
19
20
|
end
|
20
21
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Endpoints::Files
|
3
|
+
class CopyBatch < DropboxApi::Endpoints::Rpc
|
4
|
+
Method = :post
|
5
|
+
Path = '/2/files/copy_batch_v2'
|
6
|
+
ResultType = DropboxApi::Results::CopyBatchResult
|
7
|
+
|
8
|
+
include DropboxApi::OptionsValidator
|
9
|
+
|
10
|
+
# Copy multiple files or folders to different locations at once in the
|
11
|
+
# user's Dropbox.
|
12
|
+
#
|
13
|
+
# This will either finish synchronously, or return a job ID and do
|
14
|
+
# the async copy job in background. Please use {Client#copy_batch_check}
|
15
|
+
# to check the job status.
|
16
|
+
#
|
17
|
+
# Note: No errors are returned by this endpoint.
|
18
|
+
#
|
19
|
+
# @param entries [Array<Hash>] List of entries to be moved or copied.
|
20
|
+
# Each entry must be a hash with two keys: `:from_path` & `:to_path`.
|
21
|
+
# @option options autorename [Boolean] If there's a conflict with any file,
|
22
|
+
# have the Dropbox server try to autorename that file to avoid the
|
23
|
+
# conflict. The default for this field is `false`.
|
24
|
+
# @return [String, Array] Either the job id or the list of job statuses.
|
25
|
+
add_endpoint :copy_batch do |entries, options = {}|
|
26
|
+
validate_options([
|
27
|
+
:autorename
|
28
|
+
], options)
|
29
|
+
options[:autorename] ||= false
|
30
|
+
|
31
|
+
perform_request(options.merge({
|
32
|
+
entries: entries
|
33
|
+
}))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Endpoints::Files
|
3
|
+
class CopyBatchCheck < DropboxApi::Endpoints::Rpc
|
4
|
+
Method = :post
|
5
|
+
Path = '/2/files/copy_batch/check_v2'
|
6
|
+
ResultType = DropboxApi::Results::RelocationBatchResult
|
7
|
+
ErrorType = DropboxApi::Errors::PollError
|
8
|
+
|
9
|
+
# Returns the status of an asynchronous job for {Client#copy_batch}. It
|
10
|
+
# returns a list of results for each entry.
|
11
|
+
#
|
12
|
+
# @param async_job_id [String] Id of the asynchronous job.
|
13
|
+
# This is the value of a response returned from the method that
|
14
|
+
# launched the job.
|
15
|
+
# @return [:in_progress, Array] This could be either the `:in_progress`
|
16
|
+
# flag or a list of job statuses.
|
17
|
+
add_endpoint :copy_batch_check do |async_job_id|
|
18
|
+
perform_request async_job_id: async_job_id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class CopyReferenceGet < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/copy_reference/get'
|
5
6
|
ResultType = DropboxApi::Results::GetCopyReferenceResult
|
6
7
|
ErrorType = DropboxApi::Errors::GetCopyReferenceError
|
7
8
|
|
@@ -14,7 +15,7 @@ module DropboxApi::Endpoints::Files
|
|
14
15
|
# @return [DropboxApi::Results::GetCopyReferenceResult]
|
15
16
|
add_endpoint :copy_reference_get do |path|
|
16
17
|
perform_request({
|
17
|
-
:
|
18
|
+
path: path
|
18
19
|
})
|
19
20
|
end
|
20
21
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class CopyReferenceSave < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/copy_reference/save'
|
5
6
|
ResultType = DropboxApi::Results::SaveCopyReferenceResult
|
6
7
|
ErrorType = DropboxApi::Errors::SaveCopyReferenceError
|
7
8
|
|
@@ -14,8 +15,8 @@ module DropboxApi::Endpoints::Files
|
|
14
15
|
# @return [DropboxApi::Results::SaveCopyReferenceResult]
|
15
16
|
add_endpoint :copy_reference_save do |copy_reference, path|
|
16
17
|
perform_request({
|
17
|
-
:
|
18
|
-
:
|
18
|
+
copy_reference: copy_reference,
|
19
|
+
path: path
|
19
20
|
})
|
20
21
|
end
|
21
22
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class CreateFolder < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/create_folder'
|
5
6
|
ResultType = DropboxApi::Metadata::Folder
|
6
7
|
ErrorType = DropboxApi::Errors::CreateFolderError
|
7
8
|
|
@@ -11,7 +12,7 @@ module DropboxApi::Endpoints::Files
|
|
11
12
|
# @return [DropboxApi::Metadata::Folder] The new folder.
|
12
13
|
add_endpoint :create_folder do |path|
|
13
14
|
perform_request({
|
14
|
-
:
|
15
|
+
path: path
|
15
16
|
})
|
16
17
|
end
|
17
18
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Endpoints::Files
|
3
|
+
class CreateFolderBatch < DropboxApi::Endpoints::Rpc
|
4
|
+
Method = :post
|
5
|
+
Path = '/2/files/create_folder_batch'
|
6
|
+
ResultType = DropboxApi::Results::CreateFolderBatchResult
|
7
|
+
|
8
|
+
include DropboxApi::OptionsValidator
|
9
|
+
|
10
|
+
# Create multiple folders at once.
|
11
|
+
#
|
12
|
+
# This route is asynchronous for large batches, which returns a job ID
|
13
|
+
# immediately and runs the create folder batch asynchronously. Otherwise,
|
14
|
+
# creates the folders and returns the result synchronously for smaller
|
15
|
+
# inputs. You can force asynchronous behaviour by using the `:force_async`
|
16
|
+
# flag. Use {Client#create_folder_batch_check} to check the job status.
|
17
|
+
#
|
18
|
+
# Note: No errors are returned by this endpoint.
|
19
|
+
#
|
20
|
+
# @param paths [Array] List of paths to be created in the user's Dropbox.
|
21
|
+
# Duplicate path arguments in the batch are considered only once.
|
22
|
+
# @option options autorename [Boolean] If there's a conflict, have the
|
23
|
+
# Dropbox server try to autorename the folder to avoid the conflict.
|
24
|
+
# The default for this field is `false`.
|
25
|
+
# @option options force_async [Boolean] Whether to force the create to
|
26
|
+
# happen asynchronously. The default for this field is `false`.
|
27
|
+
# @return [String, Array] Either the job id or the list of job statuses.
|
28
|
+
add_endpoint :create_folder_batch do |paths, options = {}|
|
29
|
+
validate_options([
|
30
|
+
:autorename,
|
31
|
+
:force_async
|
32
|
+
], options)
|
33
|
+
options[:autorename] ||= false
|
34
|
+
options[:force_async] ||= false
|
35
|
+
|
36
|
+
perform_request(options.merge({
|
37
|
+
paths: paths
|
38
|
+
}))
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Endpoints::Files
|
3
|
+
class CreateFolderBatchCheck < DropboxApi::Endpoints::Rpc
|
4
|
+
Method = :post
|
5
|
+
Path = '/2/files/create_folder_batch/check'
|
6
|
+
ResultType = DropboxApi::Results::CreateFolderBatchResult
|
7
|
+
ErrorType = DropboxApi::Errors::PollError
|
8
|
+
|
9
|
+
# Returns the status of an asynchronous job for create_folder_batch.
|
10
|
+
# If success, it returns list of result for each entry.
|
11
|
+
#
|
12
|
+
# @param async_job_id [String] Id of the asynchronous job.
|
13
|
+
# This is the value of a response returned from the method that launched
|
14
|
+
# the job.
|
15
|
+
# @return [Array] A list of one result for each entry.
|
16
|
+
add_endpoint :create_folder_batch_check do |async_job_id|
|
17
|
+
perform_request({
|
18
|
+
async_job_id: async_job_id
|
19
|
+
})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class Delete < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/delete'
|
5
6
|
ResultType = DropboxApi::Metadata::Resource
|
6
7
|
ErrorType = DropboxApi::Errors::DeleteError
|
7
8
|
|
@@ -25,7 +26,7 @@ module DropboxApi::Endpoints::Files
|
|
25
26
|
validate_options([:parent_rev], options)
|
26
27
|
|
27
28
|
perform_request options.merge({
|
28
|
-
:
|
29
|
+
path: path
|
29
30
|
})
|
30
31
|
end
|
31
32
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Endpoints::Files
|
3
|
+
class DeleteBatch < DropboxApi::Endpoints::Rpc
|
4
|
+
Method = :post
|
5
|
+
Path = '/2/files/delete_batch'
|
6
|
+
ResultType = DropboxApi::Results::DeleteBatchResult
|
7
|
+
|
8
|
+
# Delete multiple files/folders at once.
|
9
|
+
#
|
10
|
+
# This route is asynchronous, which returns a job ID immediately and runs
|
11
|
+
# the delete batch asynchronously. Use {Client#delete_batch_check} to check
|
12
|
+
# the job status.
|
13
|
+
#
|
14
|
+
# @param entries [Array] List of entries, each entry is a Hash with these
|
15
|
+
# fields: `path` (mandatory) & parent_rev (optional).
|
16
|
+
# @return [String, Array] Either the job id or the list of job statuses.
|
17
|
+
add_endpoint :delete_batch do |entries|
|
18
|
+
perform_request({
|
19
|
+
entries: entries
|
20
|
+
})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Endpoints::Files
|
3
|
+
class DeleteBatchCheck < DropboxApi::Endpoints::Rpc
|
4
|
+
Method = :post
|
5
|
+
Path = '/2/files/delete_batch/check'
|
6
|
+
ResultType = DropboxApi::Results::DeleteBatchResult
|
7
|
+
ErrorType = DropboxApi::Errors::PollError
|
8
|
+
|
9
|
+
# Returns the status of an asynchronous job for delete_batch. If success,
|
10
|
+
# it returns list of result for each entry.
|
11
|
+
#
|
12
|
+
# @param async_job_id [String] Id of the asynchronous job.
|
13
|
+
# @return [:in_progress, Array] This could be either the `:in_progress`
|
14
|
+
# flag or a list of job statuses.
|
15
|
+
add_endpoint :delete_batch_check do |async_job_id|
|
16
|
+
perform_request({
|
17
|
+
async_job_id: async_job_id
|
18
|
+
})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class Download < DropboxApi::Endpoints::ContentDownload
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/download'
|
5
6
|
ResultType = DropboxApi::Metadata::File
|
6
7
|
ErrorType = DropboxApi::Errors::DownloadError
|
7
8
|
|
@@ -9,7 +10,7 @@ module DropboxApi::Endpoints::Files
|
|
9
10
|
#
|
10
11
|
# @param path [String] The path of the file to download.
|
11
12
|
add_endpoint :download do |path, &block|
|
12
|
-
perform_request({:
|
13
|
+
perform_request({path: path}, &block)
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class GetMetadata < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/get_metadata'
|
5
6
|
ResultType = DropboxApi::Metadata::Resource
|
6
7
|
ErrorType = DropboxApi::Errors::GetMetadataError
|
7
8
|
|
@@ -34,7 +35,7 @@ module DropboxApi::Endpoints::Files
|
|
34
35
|
], options)
|
35
36
|
|
36
37
|
perform_request(options.merge({
|
37
|
-
:
|
38
|
+
path: path
|
38
39
|
}))
|
39
40
|
end
|
40
41
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class GetPreview < DropboxApi::Endpoints::ContentDownload
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/get_preview'
|
5
6
|
ResultType = DropboxApi::Metadata::File
|
6
7
|
ErrorType = DropboxApi::Errors::PreviewError
|
7
8
|
|
@@ -11,7 +12,7 @@ module DropboxApi::Endpoints::Files
|
|
11
12
|
#
|
12
13
|
# @param path [String] The path of the file to preview.
|
13
14
|
add_endpoint :get_preview do |path, &block|
|
14
|
-
perform_request({:
|
15
|
+
perform_request({path: path}, &block)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class GetTemporaryLink < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/get_temporary_link'
|
5
6
|
ResultType = DropboxApi::Results::GetTemporaryLinkResult
|
6
7
|
ErrorType = DropboxApi::Errors::GetMetadataError
|
7
8
|
|
@@ -11,7 +12,7 @@ module DropboxApi::Endpoints::Files
|
|
11
12
|
#
|
12
13
|
# @param path [String] The path to the file you want a temporary link to.
|
13
14
|
add_endpoint :get_temporary_link do |path|
|
14
|
-
perform_request({:
|
15
|
+
perform_request({path: path})
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class GetThumbnail < DropboxApi::Endpoints::ContentDownload
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/get_thumbnail'
|
5
6
|
ResultType = DropboxApi::Metadata::File
|
6
7
|
ErrorType = DropboxApi::Errors::PreviewError
|
7
8
|
|
@@ -50,7 +51,7 @@ module DropboxApi::Endpoints::Files
|
|
50
51
|
options[:size] ||= :w64h64
|
51
52
|
|
52
53
|
perform_request(options.merge({
|
53
|
-
:
|
54
|
+
path: path
|
54
55
|
}), &block)
|
55
56
|
end
|
56
57
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class GetThumbnailBatch < DropboxApi::Endpoints::RpcContent
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/get_thumbnail_batch'
|
5
6
|
ResultType = DropboxApi::Results::GetThumbnailBatchResult
|
6
7
|
ErrorType = DropboxApi::Errors::ThumbnailBatchError
|
7
8
|
|
@@ -25,12 +26,12 @@ module DropboxApi::Endpoints::Files
|
|
25
26
|
options[:size] ||= :w64h64
|
26
27
|
options[:mode] ||= :strict
|
27
28
|
|
28
|
-
perform_request :
|
29
|
+
perform_request entries: build_entries_params(paths, options)
|
29
30
|
end
|
30
31
|
|
31
32
|
def build_entries_params(paths, options)
|
32
33
|
paths.map do |path|
|
33
|
-
options.merge({ :
|
34
|
+
options.merge({ path: path })
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class ListFolder < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/list_folder'
|
5
6
|
ResultType = DropboxApi::Results::ListFolderResult
|
6
7
|
ErrorType = DropboxApi::Errors::ListFolderError
|
7
8
|
|
@@ -41,7 +42,7 @@ module DropboxApi::Endpoints::Files
|
|
41
42
|
options[:limit] = options[:limit] if options[:limit]
|
42
43
|
|
43
44
|
perform_request options.merge({
|
44
|
-
:
|
45
|
+
path: path
|
45
46
|
})
|
46
47
|
end
|
47
48
|
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class ListFolderContinue < DropboxApi::Endpoints::Rpc
|
3
4
|
# NOTE: This hasn't been tested with real data, I couldn't make a query
|
4
5
|
# long enough to enable the `has_more` attribute in the
|
5
6
|
# `ListFolderResult`.
|
6
7
|
Method = :post
|
7
|
-
Path =
|
8
|
+
Path = '/2/files/list_folder/continue'
|
8
9
|
ResultType = DropboxApi::Results::ListFolderResult
|
9
10
|
ErrorType = DropboxApi::Errors::ListFolderContinueError
|
10
11
|
|
@@ -14,7 +15,7 @@ module DropboxApi::Endpoints::Files
|
|
14
15
|
# @param cursor [String] The cursor returned by your last call to
|
15
16
|
# list_folder or list_folder_continue.
|
16
17
|
add_endpoint :list_folder_continue do |cursor|
|
17
|
-
perform_request :
|
18
|
+
perform_request cursor: cursor
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Endpoints::Files
|
2
3
|
class ListFolderGetLatestCursor < DropboxApi::Endpoints::Rpc
|
3
4
|
Method = :post
|
4
|
-
Path =
|
5
|
+
Path = '/2/files/list_folder/get_latest_cursor'
|
5
6
|
ResultType = DropboxApi::Results::ListFolderGetLatestCursorResult
|
6
7
|
ErrorType = DropboxApi::Errors::ListFolderError
|
7
8
|
|