dropbox_api 0.1.14 → 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 -1
- data/.rubocop.yml +15 -0
- data/.travis.yml +1 -2
- data/.yardopts +1 -0
- data/Gemfile +6 -1
- data/README.md +7 -2
- data/Rakefile +4 -3
- data/TODO.md +16 -6
- data/api_coverage.md +8 -8
- data/bin/console +4 -3
- data/docs/DropboxApi.html +135 -0
- data/docs/DropboxApi/Authenticator.html +217 -0
- data/docs/DropboxApi/ChunkedUploader.html +411 -0
- data/docs/DropboxApi/Client.html +10106 -0
- data/docs/DropboxApi/ConnectionBuilder.html +326 -0
- data/docs/DropboxApi/Endpoints.html +119 -0
- data/docs/DropboxApi/Endpoints/Auth.html +115 -0
- data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +265 -0
- data/docs/DropboxApi/Endpoints/Base.html +197 -0
- data/docs/DropboxApi/Endpoints/ContentDownload.html +383 -0
- data/docs/DropboxApi/Endpoints/ContentUpload.html +351 -0
- data/docs/DropboxApi/Endpoints/Files.html +117 -0
- data/docs/DropboxApi/Endpoints/Files/Copy.html +323 -0
- 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 +304 -0
- data/docs/DropboxApi/Endpoints/Files/CopyReferenceSave.html +320 -0
- data/docs/DropboxApi/Endpoints/Files/CreateFileRequest.html +307 -0
- data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +305 -0
- 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 +341 -0
- 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 +284 -0
- data/docs/DropboxApi/Endpoints/Files/GetMetadata.html +376 -0
- data/docs/DropboxApi/Endpoints/Files/GetPreview.html +286 -0
- data/docs/DropboxApi/Endpoints/Files/GetTemporaryLink.html +286 -0
- data/docs/DropboxApi/Endpoints/Files/GetThumbnail.html +388 -0
- data/docs/DropboxApi/Endpoints/Files/GetThumbnailBatch.html +431 -0
- data/docs/DropboxApi/Endpoints/Files/ListFolder.html +402 -0
- data/docs/DropboxApi/Endpoints/Files/ListFolderContinue.html +298 -0
- data/docs/DropboxApi/Endpoints/Files/ListFolderGetLatestCursor.html +371 -0
- data/docs/DropboxApi/Endpoints/Files/ListFolderLongpoll.html +360 -0
- data/docs/DropboxApi/Endpoints/Files/ListRevisions.html +338 -0
- data/docs/DropboxApi/Endpoints/Files/Move.html +364 -0
- data/docs/DropboxApi/Endpoints/Files/PermanentlyDelete.html +337 -0
- data/docs/DropboxApi/Endpoints/Files/Restore.html +305 -0
- data/docs/DropboxApi/Endpoints/Files/SaveUrl.html +324 -0
- data/docs/DropboxApi/Endpoints/Files/SaveUrlCheckJobStatus.html +306 -0
- data/docs/DropboxApi/Endpoints/Files/Search.html +399 -0
- data/docs/DropboxApi/Endpoints/Files/Upload.html +439 -0
- data/docs/DropboxApi/Endpoints/Files/UploadSessionAppendV2.html +377 -0
- data/docs/DropboxApi/Endpoints/Files/UploadSessionFinish.html +328 -0
- data/docs/DropboxApi/Endpoints/Files/UploadSessionStart.html +350 -0
- data/docs/DropboxApi/Endpoints/Rpc.html +353 -0
- data/docs/DropboxApi/Endpoints/RpcContent.html +236 -0
- data/docs/DropboxApi/Endpoints/RpcNotify.html +240 -0
- data/docs/DropboxApi/Endpoints/Sharing.html +117 -0
- data/docs/DropboxApi/Endpoints/Sharing/AddFileMember.html +415 -0
- data/docs/DropboxApi/Endpoints/Sharing/AddFolderMember.html +400 -0
- data/docs/DropboxApi/Endpoints/Sharing/CreateSharedLinkWithSettings.html +413 -0
- data/docs/DropboxApi/Endpoints/Sharing/GetSharedLinkMetadata.html +344 -0
- data/docs/DropboxApi/Endpoints/Sharing/ListFileMembers.html +421 -0
- data/docs/DropboxApi/Endpoints/Sharing/ListFolderMembers.html +400 -0
- data/docs/DropboxApi/Endpoints/Sharing/ListSharedLinks.html +345 -0
- data/docs/DropboxApi/Endpoints/Sharing/RevokeSharedLink.html +293 -0
- data/docs/DropboxApi/Endpoints/Sharing/ShareFolder.html +428 -0
- data/docs/DropboxApi/Endpoints/Sharing/UnshareFile.html +290 -0
- data/docs/DropboxApi/Endpoints/Users.html +117 -0
- data/docs/DropboxApi/Endpoints/Users/GetAccount.html +301 -0
- data/docs/DropboxApi/Endpoints/Users/GetAccountBatch.html +303 -0
- data/docs/DropboxApi/Endpoints/Users/GetCurrentAccount.html +282 -0
- data/docs/DropboxApi/Endpoints/Users/GetSpaceUsage.html +282 -0
- data/docs/DropboxApi/Errors.html +117 -0
- data/docs/DropboxApi/Errors/AddFileMemberError.html +164 -0
- data/docs/DropboxApi/Errors/AddFolderMemberError.html +170 -0
- data/docs/DropboxApi/Errors/AddMemberSelectorError.html +165 -0
- data/docs/DropboxApi/Errors/AlreadySharedError.html +213 -0
- data/docs/DropboxApi/Errors/BadPathError.html +143 -0
- data/docs/DropboxApi/Errors/BasicError.html +356 -0
- data/docs/DropboxApi/Errors/CantCopySharedFolderError.html +143 -0
- data/docs/DropboxApi/Errors/CantMoveFolderIntoItselfError.html +143 -0
- data/docs/DropboxApi/Errors/CantNestSharedFolderError.html +143 -0
- data/docs/DropboxApi/Errors/CantShareOutsideTeamError.html +143 -0
- data/docs/DropboxApi/Errors/ContainsSharedFolderError.html +143 -0
- data/docs/DropboxApi/Errors/ConversionError.html +143 -0
- data/docs/DropboxApi/Errors/CreateFileRequestError.html +160 -0
- data/docs/DropboxApi/Errors/CreateFolderBatchError.html +161 -0
- data/docs/DropboxApi/Errors/CreateFolderError.html +161 -0
- data/docs/DropboxApi/Errors/CreateSharedLinkWithSettingsError.html +165 -0
- data/docs/DropboxApi/Errors/CursorClosedError.html +143 -0
- data/docs/DropboxApi/Errors/CursorNotClosedError.html +143 -0
- data/docs/DropboxApi/Errors/DeleteError.html +163 -0
- data/docs/DropboxApi/Errors/DisallowedNameError.html +143 -0
- data/docs/DropboxApi/Errors/DisallowedSharedLinkPolicyError.html +143 -0
- data/docs/DropboxApi/Errors/DownloadError.html +161 -0
- data/docs/DropboxApi/Errors/DownloadFailedError.html +143 -0
- data/docs/DropboxApi/Errors/EmailUnverifiedError.html +143 -0
- data/docs/DropboxApi/Errors/FileAncestorConflictError.html +143 -0
- data/docs/DropboxApi/Errors/FileConflictError.html +143 -0
- data/docs/DropboxApi/Errors/FileMemberActionError.html +164 -0
- data/docs/DropboxApi/Errors/FolderConflictError.html +143 -0
- data/docs/DropboxApi/Errors/GetAccountError.html +161 -0
- data/docs/DropboxApi/Errors/GetCopyReferenceError.html +161 -0
- data/docs/DropboxApi/Errors/GetMetadataError.html +161 -0
- data/docs/DropboxApi/Errors/GroupDeletedError.html +143 -0
- data/docs/DropboxApi/Errors/GroupNotOnTeamError.html +143 -0
- data/docs/DropboxApi/Errors/HttpError.html +124 -0
- data/docs/DropboxApi/Errors/InProgressError.html +143 -0
- data/docs/DropboxApi/Errors/InsideAppFolderError.html +143 -0
- data/docs/DropboxApi/Errors/InsideOsxPackageError.html +143 -0
- data/docs/DropboxApi/Errors/InsidePublicFolderError.html +143 -0
- data/docs/DropboxApi/Errors/InsideSharedFolderError.html +143 -0
- data/docs/DropboxApi/Errors/InsufficientPlanError.html +143 -0
- data/docs/DropboxApi/Errors/InsufficientSpaceError.html +143 -0
- data/docs/DropboxApi/Errors/InternalError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidCommentError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidCopyReferenceError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidCursorError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidDropboxIdError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidEmailError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidFileError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidIdError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidMemberError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidPathError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidRevisionError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidSettingsError.html +143 -0
- data/docs/DropboxApi/Errors/InvalidUrlError.html +143 -0
- data/docs/DropboxApi/Errors/IsAppFolderError.html +143 -0
- data/docs/DropboxApi/Errors/IsFileError.html +143 -0
- data/docs/DropboxApi/Errors/IsFolderError.html +143 -0
- data/docs/DropboxApi/Errors/IsOsxPackageError.html +143 -0
- data/docs/DropboxApi/Errors/IsPublicFolderError.html +143 -0
- data/docs/DropboxApi/Errors/ListFolderContinueError.html +162 -0
- data/docs/DropboxApi/Errors/ListFolderError.html +161 -0
- data/docs/DropboxApi/Errors/ListFolderLongpollError.html +161 -0
- data/docs/DropboxApi/Errors/ListRevisionsError.html +161 -0
- data/docs/DropboxApi/Errors/ListSharedLinksError.html +162 -0
- data/docs/DropboxApi/Errors/LookupError.html +165 -0
- data/docs/DropboxApi/Errors/MalformedPathError.html +143 -0
- data/docs/DropboxApi/Errors/NoAccountError.html +143 -0
- data/docs/DropboxApi/Errors/NoPermissionError.html +143 -0
- data/docs/DropboxApi/Errors/NoWritePermissionError.html +143 -0
- data/docs/DropboxApi/Errors/NotAMemberError.html +143 -0
- data/docs/DropboxApi/Errors/NotFileError.html +143 -0
- data/docs/DropboxApi/Errors/NotFolderError.html +143 -0
- data/docs/DropboxApi/Errors/NotFoundError.html +143 -0
- data/docs/DropboxApi/Errors/PollError.html +162 -0
- data/docs/DropboxApi/Errors/PreviewError.html +164 -0
- data/docs/DropboxApi/Errors/RateLimitError.html +143 -0
- data/docs/DropboxApi/Errors/RelocationBatchEntryError.html +163 -0
- data/docs/DropboxApi/Errors/RelocationError.html +167 -0
- data/docs/DropboxApi/Errors/RestoreError.html +163 -0
- data/docs/DropboxApi/Errors/RestrictedContentError.html +143 -0
- data/docs/DropboxApi/Errors/RevokeSharedLinkError.html +164 -0
- data/docs/DropboxApi/Errors/SaveCopyReferenceError.html +165 -0
- data/docs/DropboxApi/Errors/SaveUrlError.html +164 -0
- data/docs/DropboxApi/Errors/SearchError.html +161 -0
- data/docs/DropboxApi/Errors/SettingsError.html +162 -0
- data/docs/DropboxApi/Errors/ShareFolderError.html +165 -0
- data/docs/DropboxApi/Errors/SharePathError.html +171 -0
- data/docs/DropboxApi/Errors/SharedFolderAccessError.html +164 -0
- data/docs/DropboxApi/Errors/SharedLinkAccessDeniedError.html +143 -0
- data/docs/DropboxApi/Errors/SharedLinkAlreadyExistsError.html +143 -0
- data/docs/DropboxApi/Errors/SharedLinkError.html +163 -0
- data/docs/DropboxApi/Errors/SharedLinkMalformedError.html +143 -0
- data/docs/DropboxApi/Errors/SharedLinkNotFoundError.html +143 -0
- data/docs/DropboxApi/Errors/SharingFileAccessError.html +165 -0
- data/docs/DropboxApi/Errors/SharingUserError.html +161 -0
- data/docs/DropboxApi/Errors/TeamFolderError.html +143 -0
- data/docs/DropboxApi/Errors/TeamPolicyDisallowsMemberPolicyError.html +143 -0
- data/docs/DropboxApi/Errors/ThumbnailBatchError.html +161 -0
- data/docs/DropboxApi/Errors/ThumbnailError.html +164 -0
- data/docs/DropboxApi/Errors/TooManyFilesError.html +143 -0
- data/docs/DropboxApi/Errors/TooManyMembersError.html +143 -0
- data/docs/DropboxApi/Errors/TooManyPendingInvitesError.html +143 -0
- data/docs/DropboxApi/Errors/TooManyRequestsError.html +321 -0
- data/docs/DropboxApi/Errors/TooManySharedFolderTargetsError.html +143 -0
- data/docs/DropboxApi/Errors/TooManyWriteOperationsError.html +167 -0
- data/docs/DropboxApi/Errors/UnmountedError.html +143 -0
- data/docs/DropboxApi/Errors/UnshareFileError.html +162 -0
- data/docs/DropboxApi/Errors/UnsupportedContentError.html +143 -0
- data/docs/DropboxApi/Errors/UnsupportedExtensionError.html +143 -0
- data/docs/DropboxApi/Errors/UnsupportedImageError.html +143 -0
- data/docs/DropboxApi/Errors/UnsupportedLinkTypeError.html +143 -0
- data/docs/DropboxApi/Errors/UnverifiedDropboxId.html +143 -0
- data/docs/DropboxApi/Errors/UploadError.html +161 -0
- data/docs/DropboxApi/Errors/UploadSessionFinishError.html +163 -0
- data/docs/DropboxApi/Errors/UploadSessionLookupError.html +164 -0
- data/docs/DropboxApi/Errors/UploadSessionOffsetError.html +220 -0
- data/docs/DropboxApi/Errors/UploadWriteFailedError.html +161 -0
- data/docs/DropboxApi/Errors/WriteConflictError.html +163 -0
- data/docs/DropboxApi/Errors/WriteError.html +165 -0
- data/docs/DropboxApi/Metadata.html +117 -0
- data/docs/DropboxApi/Metadata/AccessLevel.html +259 -0
- data/docs/DropboxApi/Metadata/AddFileMemberResult.html +164 -0
- data/docs/DropboxApi/Metadata/AddMember.html +246 -0
- data/docs/DropboxApi/Metadata/Base.html +545 -0
- data/docs/DropboxApi/Metadata/BasicAccount.html +167 -0
- data/docs/DropboxApi/Metadata/CommitInfo.html +232 -0
- data/docs/DropboxApi/Metadata/Deleted.html +158 -0
- data/docs/DropboxApi/Metadata/Dimensions.html +140 -0
- data/docs/DropboxApi/Metadata/Field.html +358 -0
- data/docs/DropboxApi/Metadata/File.html +238 -0
- data/docs/DropboxApi/Metadata/FileLinkMetadata.html +180 -0
- data/docs/DropboxApi/Metadata/FileMemberAction.html +230 -0
- data/docs/DropboxApi/Metadata/FileRequest.html +167 -0
- data/docs/DropboxApi/Metadata/Folder.html +228 -0
- data/docs/DropboxApi/Metadata/FolderLinkMetadata.html +140 -0
- data/docs/DropboxApi/Metadata/FolderSharingInfo.html +156 -0
- data/docs/DropboxApi/Metadata/LinkPermissions.html +161 -0
- data/docs/DropboxApi/Metadata/Location.html +140 -0
- data/docs/DropboxApi/Metadata/MediaInfo.html +245 -0
- data/docs/DropboxApi/Metadata/MediaMetadata.html +237 -0
- data/docs/DropboxApi/Metadata/Member.html +313 -0
- data/docs/DropboxApi/Metadata/MemberAction.html +274 -0
- data/docs/DropboxApi/Metadata/MemberActionList.html +221 -0
- data/docs/DropboxApi/Metadata/MemberPermission.html +163 -0
- data/docs/DropboxApi/Metadata/MemberPermissionList.html +237 -0
- data/docs/DropboxApi/Metadata/Name.html +158 -0
- data/docs/DropboxApi/Metadata/ParentFolderAccessInfo.html +140 -0
- data/docs/DropboxApi/Metadata/PhotoMetadata.html +164 -0
- data/docs/DropboxApi/Metadata/Resource.html +207 -0
- data/docs/DropboxApi/Metadata/SharedFolder.html +165 -0
- data/docs/DropboxApi/Metadata/SharedFolderPolicy.html +156 -0
- data/docs/DropboxApi/Metadata/SharedLink.html +375 -0
- data/docs/DropboxApi/Metadata/SharedLinkMetadata.html +204 -0
- data/docs/DropboxApi/Metadata/SpaceAllocation.html +156 -0
- data/docs/DropboxApi/Metadata/SpaceUsage.html +159 -0
- data/docs/DropboxApi/Metadata/Tag.html +293 -0
- data/docs/DropboxApi/Metadata/Team.html +140 -0
- data/docs/DropboxApi/Metadata/TeamMemberInfo.html +160 -0
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultData.html +140 -0
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultEntry.html +221 -0
- data/docs/DropboxApi/Metadata/UploadSessionCursor.html +226 -0
- data/docs/DropboxApi/Metadata/VideoMetadata.html +165 -0
- data/docs/DropboxApi/Metadata/WriteMode.html +439 -0
- data/docs/DropboxApi/MiddleWare.html +117 -0
- data/docs/DropboxApi/MiddleWare/DecodeResult.html +273 -0
- data/docs/DropboxApi/MiddleWare/Stack.html +452 -0
- data/docs/DropboxApi/OptionsValidator.html +234 -0
- data/docs/DropboxApi/ResultBuilder.html +570 -0
- data/docs/DropboxApi/Results.html +119 -0
- data/docs/DropboxApi/Results/AddFileMemberResultList.html +227 -0
- data/docs/DropboxApi/Results/Base.html +206 -0
- data/docs/DropboxApi/Results/BasicAccountBatch.html +205 -0
- 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 +351 -0
- data/docs/DropboxApi/Results/GetTemporaryLinkResult.html +263 -0
- data/docs/DropboxApi/Results/GetThumbnailBatchResult.html +214 -0
- data/docs/DropboxApi/Results/ListFolderGetLatestCursorResult.html +210 -0
- data/docs/DropboxApi/Results/ListFolderLongpollResult.html +287 -0
- data/docs/DropboxApi/Results/ListFolderResult.html +368 -0
- data/docs/DropboxApi/Results/ListRevisionsResult.html +300 -0
- data/docs/DropboxApi/Results/ListSharedLinksResult.html +368 -0
- data/docs/DropboxApi/Results/RelocationBatchResult.html +241 -0
- data/docs/DropboxApi/Results/RelocationBatchResultEntry.html +226 -0
- data/docs/DropboxApi/Results/SaveCopyReferenceResult.html +221 -0
- data/docs/DropboxApi/Results/SaveUrlJobStatus.html +230 -0
- data/docs/DropboxApi/Results/SaveUrlResult.html +227 -0
- data/docs/DropboxApi/Results/Search.html +115 -0
- data/docs/DropboxApi/Results/Search/Match.html +314 -0
- data/docs/DropboxApi/Results/SearchResult.html +368 -0
- data/docs/DropboxApi/Results/ShareFolderLaunch.html +205 -0
- data/docs/DropboxApi/Results/SharedFileMembers.html +369 -0
- data/docs/DropboxApi/Results/SharedFolderMembers.html +369 -0
- data/docs/DropboxApi/Results/UploadSessionStart.html +210 -0
- data/docs/DropboxApi/Results/VoidResult.html +140 -0
- data/docs/DropboxScaffoldBuilder.html +1172 -0
- data/docs/_index.html +2110 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +4 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +257 -0
- data/docs/file.api_coverage.html +595 -0
- data/docs/file.rails_setup.html +152 -0
- data/docs/file_list.html +66 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +257 -0
- data/docs/js/app.js +303 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1955 -0
- data/docs/top-level-namespace.html +112 -0
- data/dropbox_api.gemspec +15 -16
- data/lib/dropbox_api.rb +30 -3
- data/lib/dropbox_api/authenticator.rb +3 -2
- data/lib/dropbox_api/chunked_uploader.rb +2 -0
- 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 +11 -4
- 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 +29 -4
- 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 +24 -0
- 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 +3 -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 +11 -0
- 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 +4 -3
- 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/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 +330 -36
- data/CHANGES.md +0 -7
- data/lib/dropbox_api/results/search_result.rb +0 -22
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Metadata
|
2
3
|
class SharedLink < Base
|
3
4
|
VALID_KEYS = [:url, :password]
|
@@ -6,7 +7,7 @@ module DropboxApi::Metadata
|
|
6
7
|
@shared_link =
|
7
8
|
case param
|
8
9
|
when String
|
9
|
-
{:
|
10
|
+
{url: param}
|
10
11
|
when Hash
|
11
12
|
param
|
12
13
|
end
|
@@ -16,7 +17,7 @@ module DropboxApi::Metadata
|
|
16
17
|
|
17
18
|
def check_validity
|
18
19
|
if @shared_link[:url].nil?
|
19
|
-
raise ArgumentError,
|
20
|
+
raise ArgumentError, 'Missing `:url` option'
|
20
21
|
end
|
21
22
|
|
22
23
|
@shared_link.keys.each do |key|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Metadata
|
2
3
|
# This class is used as an adapter so we can create an object of the pertinent
|
3
4
|
# class when we need to infer the type from the data.
|
@@ -6,7 +7,7 @@ module DropboxApi::Metadata
|
|
6
7
|
class SharedLinkMetadata
|
7
8
|
class << self
|
8
9
|
def new(data)
|
9
|
-
class_for(data[
|
10
|
+
class_for(data['.tag'].to_sym).new(data)
|
10
11
|
end
|
11
12
|
|
12
13
|
private
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Metadata
|
2
3
|
class Tag < DropboxApi::Metadata::Base
|
3
4
|
def self.new(data)
|
@@ -5,7 +6,7 @@ module DropboxApi::Metadata
|
|
5
6
|
when ::Symbol
|
6
7
|
validate(data)
|
7
8
|
when Hash
|
8
|
-
new(data[
|
9
|
+
new(data['.tag'].to_sym)
|
9
10
|
when String
|
10
11
|
new(data.to_sym)
|
11
12
|
else
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Metadata
|
2
3
|
# This class is used as an adapter so we can create an object of the pertinent
|
3
4
|
# class when we need to infer the type from the data.
|
@@ -9,11 +10,11 @@ module DropboxApi::Metadata
|
|
9
10
|
class ThumbnailBatchResultEntry
|
10
11
|
class << self
|
11
12
|
def new(data)
|
12
|
-
case data[
|
13
|
+
case data['.tag'].to_sym
|
13
14
|
when :success
|
14
15
|
DropboxApi::Metadata::ThumbnailBatchResultData.new(data)
|
15
16
|
when :failure
|
16
|
-
DropboxApi::Errors::ThumbnailError.build(
|
17
|
+
DropboxApi::Errors::ThumbnailError.build('Thumbnail generation failed', data['failure'])
|
17
18
|
else
|
18
19
|
raise NotImplementedError, "Unknown result type: #{data[".tag"]}"
|
19
20
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Metadata
|
2
3
|
# Your intent when writing a file to some path. This is used to determine
|
3
4
|
# what constitutes a conflict and what the autorename strategy is.
|
@@ -48,22 +49,22 @@ module DropboxApi::Metadata
|
|
48
49
|
@write_mode = write_mode
|
49
50
|
when String, ::Symbol
|
50
51
|
@write_mode = {
|
51
|
-
|
52
|
+
'.tag' => write_mode
|
52
53
|
}
|
53
54
|
@write_mode[write_mode.to_s] = options unless options.nil?
|
54
55
|
end
|
55
|
-
@write_mode[
|
56
|
+
@write_mode['.tag'] = @write_mode['.tag'].to_sym
|
56
57
|
|
57
58
|
check_validity
|
58
59
|
end
|
59
60
|
|
60
61
|
def check_validity
|
61
|
-
unless valid_mode? @write_mode[
|
62
|
+
unless valid_mode? @write_mode['.tag']
|
62
63
|
raise ArgumentError, "Invalid write mode: #{@write_mode[".tag"]}"
|
63
64
|
end
|
64
65
|
|
65
|
-
if @write_mode[
|
66
|
-
raise ArgumentError,
|
66
|
+
if @write_mode['.tag'] == :update && @write_mode['update'].nil?
|
67
|
+
raise ArgumentError, 'Mode `:update` expects a `rev` number'
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::MiddleWare
|
2
3
|
class DecodeResult < Faraday::Middleware
|
3
4
|
def call(rq_env)
|
@@ -14,7 +15,7 @@ module DropboxApi::MiddleWare
|
|
14
15
|
# Dropbox may send a response with the string 'null' in its body, this
|
15
16
|
# would be a void result. `add_folder_member` is an example of an
|
16
17
|
# endpoint without return values.
|
17
|
-
if json ==
|
18
|
+
if json == 'null'
|
18
19
|
{}
|
19
20
|
else
|
20
21
|
JSON.parse json
|
@@ -22,5 +23,5 @@ module DropboxApi::MiddleWare
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
Faraday::Response.register_middleware :
|
26
|
+
Faraday::Response.register_middleware decode_result: DecodeResult
|
26
27
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi
|
2
3
|
class ResultBuilder
|
3
4
|
def initialize(response_data)
|
@@ -5,11 +6,11 @@ module DropboxApi
|
|
5
6
|
end
|
6
7
|
|
7
8
|
def error_summary
|
8
|
-
@response_data[
|
9
|
+
@response_data['error_summary'] if @response_data.is_a? Hash
|
9
10
|
end
|
10
11
|
|
11
12
|
def error
|
12
|
-
@response_data[
|
13
|
+
@response_data['error']
|
13
14
|
end
|
14
15
|
|
15
16
|
def has_error?
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Results
|
3
|
+
class CopyBatchResult < DropboxApi::Results::Base
|
4
|
+
def self.new(result_data)
|
5
|
+
case result_data['.tag']
|
6
|
+
when 'async_job_id'
|
7
|
+
result_data['async_job_id']
|
8
|
+
when 'complete'
|
9
|
+
RelocationBatchResult.new(result_data)
|
10
|
+
else
|
11
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Results
|
3
|
+
# Result returned by {Client#create_folder_batch} that may either launch an
|
4
|
+
# asynchronous job or complete synchronously.
|
5
|
+
#
|
6
|
+
# The value will be either a job id or a list of job statuses.
|
7
|
+
class CreateFolderBatchResult < DropboxApi::Results::Base
|
8
|
+
def self.new(result_data)
|
9
|
+
case result_data['.tag']
|
10
|
+
when 'async_job_id'
|
11
|
+
result_data
|
12
|
+
when 'complete'
|
13
|
+
result_data['entries'].map do |entry|
|
14
|
+
DropboxApi::Results::CreateFolderBatchResultEntry.new(entry)
|
15
|
+
end
|
16
|
+
else
|
17
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Results
|
3
|
+
class CreateFolderBatchResultEntry < DropboxApi::Results::Base
|
4
|
+
def self.new(result_data)
|
5
|
+
case result_data['.tag']
|
6
|
+
when 'success'
|
7
|
+
DropboxApi::Metadata::Folder.new result_data['metadata']
|
8
|
+
when 'failure'
|
9
|
+
# At the moment, this is a `CreateFolderEntryError` which is an open
|
10
|
+
# union that can only be a `WriteError`. In the future, more errors
|
11
|
+
# could be added to the API which means we'd have to implement the
|
12
|
+
# actual `CreateFolderEntryError` class.
|
13
|
+
DropboxApi::Errors::WriteError
|
14
|
+
.build('Folder operation failed', result_data['failure']['path'])
|
15
|
+
else
|
16
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Results
|
3
|
+
# Result returned by {Client#delete_batch} that may either launch an
|
4
|
+
# asynchronous job or complete synchronously.
|
5
|
+
#
|
6
|
+
# The value will be either a job id or a list of job statuses.
|
7
|
+
class DeleteBatchResult < DropboxApi::Results::Base
|
8
|
+
def self.new(result_data)
|
9
|
+
case result_data['.tag']
|
10
|
+
when 'async_job_id'
|
11
|
+
result_data
|
12
|
+
when 'complete'
|
13
|
+
result_data['entries'].map do |entry|
|
14
|
+
DropboxApi::Results::DeleteBatchResultEntry.new(entry)
|
15
|
+
end
|
16
|
+
else
|
17
|
+
raise NotImplementedError, "Unknown result type: #{result_data[".tag"]}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module DropboxApi::Results
|
3
|
+
class DeleteBatchResultEntry < DropboxApi::Results::Base
|
4
|
+
def self.new(result_data)
|
5
|
+
case result_data['.tag']
|
6
|
+
when 'success'
|
7
|
+
DropboxApi::Metadata::Resource.new result_data['metadata']
|
8
|
+
when 'failure'
|
9
|
+
DropboxApi::Errors::DeleteError
|
10
|
+
.build('Delete operation failed', result_data['failure'])
|
11
|
+
else
|
12
|
+
raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,20 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Results
|
2
3
|
class GetCopyReferenceResult < DropboxApi::Results::Base
|
3
4
|
# Metadata of the file or folder.
|
4
5
|
def resource
|
5
|
-
@resource ||= DropboxApi::Metadata::Resource.new @data[
|
6
|
+
@resource ||= DropboxApi::Metadata::Resource.new @data['metadata']
|
6
7
|
end
|
7
8
|
|
8
9
|
# A copy reference to the file or folder.
|
9
10
|
def copy_reference
|
10
|
-
@copy_reference ||= @data[
|
11
|
+
@copy_reference ||= @data['copy_reference']
|
11
12
|
end
|
12
13
|
|
13
14
|
# The expiration date of the copy reference.
|
14
15
|
# This value is currently set to be far enough in the future
|
15
16
|
# so that expiration is effectively not an issue.
|
16
17
|
def expires
|
17
|
-
@expires ||= Time.parse(@data[
|
18
|
+
@expires ||= Time.parse(@data['expires'])
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
@@ -1,11 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Results
|
2
3
|
class GetTemporaryLinkResult < DropboxApi::Results::Base
|
3
4
|
def file
|
4
|
-
@file ||= DropboxApi::Metadata::File.new(@data[
|
5
|
+
@file ||= DropboxApi::Metadata::File.new(@data['metadata'])
|
5
6
|
end
|
6
7
|
|
7
8
|
def link
|
8
|
-
@data[
|
9
|
+
@data['link']
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Results
|
2
3
|
class GetThumbnailBatchResult < DropboxApi::Results::Base
|
3
4
|
def entries
|
4
|
-
@entries ||= @data[
|
5
|
+
@entries ||= @data['entries'].map do |entry|
|
5
6
|
DropboxApi::Metadata::ThumbnailBatchResultEntry.new entry
|
6
7
|
end
|
7
8
|
end
|
@@ -1,15 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Results
|
2
3
|
class ListFolderLongpollResult < DropboxApi::Results::Base
|
3
4
|
# Indicates whether new changes are available. If true, call
|
4
5
|
# `list_folder_continue` to retrieve the changes.
|
5
6
|
def changes
|
6
|
-
@data[
|
7
|
+
@data['changes'].to_s == 'true'
|
7
8
|
end
|
8
9
|
|
9
10
|
# If present, backoff for at least this many seconds before calling
|
10
11
|
# `list_folder_longpoll` again. This field is optional.
|
11
12
|
def backoff
|
12
|
-
@data[
|
13
|
+
@data['backoff']
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Results
|
2
3
|
class ListFolderResult < DropboxApi::Results::Base
|
3
4
|
# A collection of files and directories.
|
4
5
|
def entries
|
5
|
-
@entries ||= @data[
|
6
|
+
@entries ||= @data['entries'].map do |entry|
|
6
7
|
DropboxApi::Metadata::Resource.new entry
|
7
8
|
end
|
8
9
|
end
|
@@ -10,13 +11,13 @@ module DropboxApi::Results
|
|
10
11
|
# Pass the cursor into `list_folder_continue` to see what's changed in the
|
11
12
|
# folder since your previous query.
|
12
13
|
def cursor
|
13
|
-
@data[
|
14
|
+
@data['cursor']
|
14
15
|
end
|
15
16
|
|
16
17
|
# If true, then there are more entries available. Pass the cursor to
|
17
18
|
# `list_folder_continue` to retrieve the rest.
|
18
19
|
def has_more?
|
19
|
-
@data[
|
20
|
+
@data['has_more'].to_s == 'true'
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -1,14 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module DropboxApi::Results
|
2
3
|
class ListRevisionsResult < DropboxApi::Results::Base
|
3
4
|
# A collection of files and directories.
|
4
5
|
def entries
|
5
|
-
@entries ||= @data[
|
6
|
+
@entries ||= @data['entries'].map do |entry|
|
6
7
|
DropboxApi::Metadata::File.new entry
|
7
8
|
end
|
8
9
|
end
|
9
10
|
|
10
11
|
def is_deleted?
|
11
|
-
@data[
|
12
|
+
@data['is_deleted'] == true
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|