dropbox_api 0.1.16 → 0.1.21
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 +26 -1
- data/README.md +120 -24
- data/Rakefile +4 -3
- data/TODO.md +24 -7
- data/api_coverage.md +8 -8
- data/bin/console +4 -3
- data/docs/DropboxApi/Authenticator.html +14 -20
- data/docs/DropboxApi/ChunkedUploader.html +20 -20
- data/docs/DropboxApi/Client.html +3446 -992
- data/docs/DropboxApi/ConnectionBuilder.html +266 -31
- data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +13 -13
- data/docs/DropboxApi/Endpoints/Auth.html +6 -6
- data/docs/DropboxApi/Endpoints/Base.html +92 -11
- data/docs/DropboxApi/Endpoints/ContentDownload.html +37 -48
- data/docs/DropboxApi/Endpoints/ContentUpload.html +35 -46
- data/docs/DropboxApi/Endpoints/Files/Copy.html +15 -15
- 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 +14 -14
- data/docs/DropboxApi/Endpoints/Files/CopyReferenceSave.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/CreateFileRequest.html +13 -13
- data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +14 -14
- 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 +14 -14
- 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 +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetMetadata.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetPreview.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetTemporaryLink.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetThumbnail.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/GetThumbnailBatch.html +19 -19
- data/docs/DropboxApi/Endpoints/Files/ListFolder.html +39 -20
- data/docs/DropboxApi/Endpoints/Files/ListFolderContinue.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/ListFolderGetLatestCursor.html +13 -13
- data/docs/DropboxApi/Endpoints/Files/ListFolderLongpoll.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/ListRevisions.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/Move.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/PermanentlyDelete.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/Restore.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/SaveUrl.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/SaveUrlCheckJobStatus.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/Search.html +51 -99
- data/docs/DropboxApi/Endpoints/Files/SearchContinue.html +300 -0
- data/docs/DropboxApi/Endpoints/Files/Upload.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/UploadSessionAppendV2.html +14 -14
- data/docs/DropboxApi/Endpoints/Files/UploadSessionFinish.html +15 -15
- data/docs/DropboxApi/Endpoints/Files/UploadSessionStart.html +15 -15
- data/docs/DropboxApi/Endpoints/Files.html +8 -8
- data/docs/DropboxApi/Endpoints/Rpc.html +36 -47
- data/docs/DropboxApi/Endpoints/RpcContent.html +28 -33
- data/docs/DropboxApi/Endpoints/RpcNotify.html +28 -33
- data/docs/DropboxApi/Endpoints/Sharing/AddFileMember.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/AddFolderMember.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/CreateSharedLinkWithSettings.html +110 -19
- data/docs/DropboxApi/Endpoints/Sharing/GetSharedLinkMetadata.html +14 -14
- data/docs/DropboxApi/Endpoints/Sharing/ListFileMembers.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/ListFolderMembers.html +15 -15
- data/docs/DropboxApi/Endpoints/Sharing/ListSharedLinks.html +13 -13
- data/docs/DropboxApi/Endpoints/Sharing/RevokeSharedLink.html +293 -0
- data/docs/DropboxApi/Endpoints/Sharing/ShareFolder.html +14 -14
- data/docs/DropboxApi/Endpoints/Sharing/UnshareFile.html +14 -14
- data/docs/DropboxApi/Endpoints/Sharing.html +8 -8
- data/docs/DropboxApi/Endpoints/Users/GetAccount.html +14 -14
- data/docs/DropboxApi/Endpoints/Users/GetAccountBatch.html +14 -14
- data/docs/DropboxApi/Endpoints/Users/GetCurrentAccount.html +13 -13
- data/docs/DropboxApi/Endpoints/Users/GetSpaceUsage.html +13 -13
- data/docs/DropboxApi/Endpoints/Users.html +6 -6
- data/docs/DropboxApi/Endpoints.html +6 -6
- data/docs/DropboxApi/Errors/AddFileMemberError.html +10 -10
- data/docs/DropboxApi/Errors/AddFolderMemberError.html +16 -16
- data/docs/DropboxApi/Errors/AddMemberSelectorError.html +11 -11
- data/docs/DropboxApi/Errors/AlreadySharedError.html +9 -9
- data/docs/DropboxApi/Errors/BadPathError.html +6 -6
- data/docs/DropboxApi/Errors/BasicError.html +18 -18
- data/docs/DropboxApi/Errors/CantCopySharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/CantMoveFolderIntoItselfError.html +6 -6
- data/docs/DropboxApi/Errors/CantNestSharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/CantShareOutsideTeamError.html +6 -6
- data/docs/DropboxApi/Errors/ContainsSharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/ConversionError.html +6 -6
- data/docs/DropboxApi/Errors/CreateFileRequestError.html +6 -6
- data/docs/DropboxApi/Errors/CreateFolderBatchError.html +161 -0
- data/docs/DropboxApi/Errors/CreateFolderError.html +7 -7
- data/docs/DropboxApi/Errors/CreateSharedLinkWithSettingsError.html +11 -11
- data/docs/DropboxApi/Errors/CursorClosedError.html +6 -6
- data/docs/DropboxApi/Errors/CursorNotClosedError.html +6 -6
- data/docs/DropboxApi/Errors/DeleteError.html +9 -8
- data/docs/DropboxApi/Errors/DisallowedNameError.html +6 -6
- data/docs/DropboxApi/Errors/DisallowedSharedLinkPolicyError.html +6 -6
- data/docs/DropboxApi/Errors/DownloadError.html +7 -7
- data/docs/DropboxApi/Errors/DownloadFailedError.html +6 -6
- data/docs/DropboxApi/Errors/EmailUnverifiedError.html +6 -6
- data/docs/DropboxApi/Errors/ExpiredAccessTokenError.html +143 -0
- data/docs/DropboxApi/Errors/FileAncestorConflictError.html +6 -6
- data/docs/DropboxApi/Errors/FileConflictError.html +6 -6
- data/docs/DropboxApi/Errors/FileMemberActionError.html +10 -10
- data/docs/DropboxApi/Errors/FolderConflictError.html +6 -6
- data/docs/DropboxApi/Errors/GetAccountError.html +7 -7
- data/docs/DropboxApi/Errors/GetCopyReferenceError.html +7 -7
- data/docs/DropboxApi/Errors/GetMetadataError.html +7 -7
- data/docs/DropboxApi/Errors/GroupDeletedError.html +6 -6
- data/docs/DropboxApi/Errors/GroupNotOnTeamError.html +6 -6
- data/docs/DropboxApi/Errors/HttpError.html +6 -6
- data/docs/DropboxApi/Errors/InProgressError.html +6 -6
- data/docs/DropboxApi/Errors/InsideAppFolderError.html +6 -6
- data/docs/DropboxApi/Errors/InsideOsxPackageError.html +6 -6
- data/docs/DropboxApi/Errors/InsidePublicFolderError.html +6 -6
- data/docs/DropboxApi/Errors/InsideSharedFolderError.html +6 -6
- data/docs/DropboxApi/Errors/InsufficientPlanError.html +6 -6
- data/docs/DropboxApi/Errors/InsufficientSpaceError.html +6 -6
- data/docs/DropboxApi/Errors/InternalError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidCommentError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidCopyReferenceError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidCursorError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidDropboxIdError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidEmailError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidFileError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidIdError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidMemberError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidPathError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidRevisionError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidSettingsError.html +6 -6
- data/docs/DropboxApi/Errors/InvalidUrlError.html +6 -6
- data/docs/DropboxApi/Errors/IsAppFolderError.html +6 -6
- data/docs/DropboxApi/Errors/IsFileError.html +6 -6
- data/docs/DropboxApi/Errors/IsFolderError.html +6 -6
- data/docs/DropboxApi/Errors/IsOsxPackageError.html +6 -6
- data/docs/DropboxApi/Errors/IsPublicFolderError.html +6 -6
- data/docs/DropboxApi/Errors/ListFolderContinueError.html +8 -8
- data/docs/DropboxApi/Errors/ListFolderError.html +7 -7
- data/docs/DropboxApi/Errors/ListFolderLongpollError.html +7 -7
- data/docs/DropboxApi/Errors/ListRevisionsError.html +7 -7
- data/docs/DropboxApi/Errors/ListSharedLinksError.html +8 -8
- data/docs/DropboxApi/Errors/LookupError.html +11 -11
- data/docs/DropboxApi/Errors/MalformedPathError.html +6 -6
- data/docs/DropboxApi/Errors/NoAccountError.html +6 -6
- data/docs/DropboxApi/Errors/NoPermissionError.html +6 -6
- data/docs/DropboxApi/Errors/NoWritePermissionError.html +6 -6
- data/docs/DropboxApi/Errors/NotAMemberError.html +6 -6
- data/docs/DropboxApi/Errors/NotFileError.html +6 -6
- data/docs/DropboxApi/Errors/NotFolderError.html +6 -6
- data/docs/DropboxApi/Errors/NotFoundError.html +6 -6
- data/docs/DropboxApi/Errors/PollError.html +8 -8
- data/docs/DropboxApi/Errors/PreviewError.html +10 -10
- data/docs/DropboxApi/Errors/RateLimitError.html +6 -6
- data/docs/DropboxApi/Errors/RelocationBatchEntryError.html +163 -0
- data/docs/DropboxApi/Errors/RelocationError.html +13 -13
- data/docs/DropboxApi/Errors/RestoreError.html +9 -9
- data/docs/DropboxApi/Errors/RestrictedContentError.html +6 -6
- data/docs/DropboxApi/Errors/RevokeSharedLinkError.html +164 -0
- data/docs/DropboxApi/Errors/SaveCopyReferenceError.html +11 -11
- data/docs/DropboxApi/Errors/SaveUrlError.html +10 -10
- data/docs/DropboxApi/Errors/SearchError.html +7 -7
- data/docs/DropboxApi/Errors/SettingsError.html +8 -8
- data/docs/DropboxApi/Errors/ShareFolderError.html +11 -11
- data/docs/DropboxApi/Errors/SharePathError.html +17 -17
- data/docs/DropboxApi/Errors/SharedFolderAccessError.html +10 -10
- data/docs/DropboxApi/Errors/SharedLinkAccessDeniedError.html +6 -6
- data/docs/DropboxApi/Errors/SharedLinkAlreadyExistsError.html +6 -6
- data/docs/DropboxApi/Errors/SharedLinkError.html +9 -9
- data/docs/DropboxApi/Errors/SharedLinkMalformedError.html +143 -0
- data/docs/DropboxApi/Errors/SharedLinkNotFoundError.html +6 -6
- data/docs/DropboxApi/Errors/SharingFileAccessError.html +11 -11
- data/docs/DropboxApi/Errors/SharingUserError.html +7 -7
- data/docs/DropboxApi/Errors/TeamFolderError.html +6 -6
- data/docs/DropboxApi/Errors/TeamPolicyDisallowsMemberPolicyError.html +6 -6
- data/docs/DropboxApi/Errors/ThumbnailBatchError.html +7 -7
- data/docs/DropboxApi/Errors/ThumbnailError.html +10 -10
- data/docs/DropboxApi/Errors/TooManyFilesError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyMembersError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyPendingInvitesError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyRequestsError.html +15 -15
- data/docs/DropboxApi/Errors/TooManySharedFolderTargetsError.html +6 -6
- data/docs/DropboxApi/Errors/TooManyWriteOperationsError.html +6 -6
- data/docs/DropboxApi/Errors/UnmountedError.html +6 -6
- data/docs/DropboxApi/Errors/UnshareFileError.html +8 -8
- data/docs/DropboxApi/Errors/UnsupportedContentError.html +6 -6
- data/docs/DropboxApi/Errors/UnsupportedExtensionError.html +6 -6
- data/docs/DropboxApi/Errors/UnsupportedImageError.html +6 -6
- data/docs/DropboxApi/Errors/UnsupportedLinkTypeError.html +6 -6
- data/docs/DropboxApi/Errors/UnverifiedDropboxId.html +6 -6
- data/docs/DropboxApi/Errors/UploadError.html +7 -7
- data/docs/DropboxApi/Errors/UploadSessionFinishError.html +9 -9
- data/docs/DropboxApi/Errors/UploadSessionLookupError.html +10 -10
- data/docs/DropboxApi/Errors/UploadSessionOffsetError.html +10 -10
- data/docs/DropboxApi/Errors/UploadWriteFailedError.html +7 -7
- data/docs/DropboxApi/Errors/WriteConflictError.html +9 -9
- data/docs/DropboxApi/Errors/WriteError.html +11 -11
- data/docs/DropboxApi/Errors.html +8 -8
- data/docs/DropboxApi/Metadata/AccessLevel.html +9 -9
- data/docs/DropboxApi/Metadata/AddFileMemberResult.html +6 -6
- data/docs/DropboxApi/Metadata/AddMember.html +11 -11
- data/docs/DropboxApi/Metadata/Base.html +24 -24
- data/docs/DropboxApi/Metadata/BasicAccount.html +12 -7
- data/docs/DropboxApi/Metadata/CommitInfo.html +9 -9
- data/docs/DropboxApi/Metadata/Deleted.html +6 -6
- data/docs/DropboxApi/Metadata/Dimensions.html +6 -6
- data/docs/DropboxApi/Metadata/Field.html +24 -20
- data/docs/DropboxApi/Metadata/File.html +10 -10
- data/docs/DropboxApi/Metadata/FileCategoriesList.html +205 -0
- data/docs/DropboxApi/Metadata/FileCategory.html +250 -0
- data/docs/DropboxApi/Metadata/FileExtensionsList.html +213 -0
- data/docs/DropboxApi/Metadata/FileLinkMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/FileMemberAction.html +10 -10
- data/docs/DropboxApi/Metadata/FileRequest.html +6 -6
- data/docs/DropboxApi/Metadata/FileStatus.html +242 -0
- data/docs/DropboxApi/Metadata/Folder.html +10 -10
- data/docs/DropboxApi/Metadata/FolderLinkMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/FolderSharingInfo.html +6 -6
- data/docs/DropboxApi/Metadata/LinkPermissions.html +6 -6
- data/docs/DropboxApi/Metadata/Location.html +6 -6
- data/docs/DropboxApi/Metadata/MediaInfo.html +9 -9
- data/docs/DropboxApi/Metadata/MediaMetadata.html +9 -9
- data/docs/DropboxApi/Metadata/Member.html +13 -13
- data/docs/DropboxApi/Metadata/MemberAction.html +9 -9
- data/docs/DropboxApi/Metadata/MemberActionList.html +9 -9
- data/docs/DropboxApi/Metadata/MemberPermission.html +6 -6
- data/docs/DropboxApi/Metadata/MemberPermissionList.html +10 -10
- data/docs/DropboxApi/Metadata/MetadataV2.html +140 -0
- data/docs/DropboxApi/Metadata/Name.html +6 -6
- data/docs/DropboxApi/Metadata/NamespaceId.html +210 -0
- data/docs/DropboxApi/Metadata/ParentFolderAccessInfo.html +6 -6
- data/docs/DropboxApi/Metadata/PhotoMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/Resource.html +10 -10
- data/docs/DropboxApi/Metadata/RootInfo.html +227 -0
- data/docs/DropboxApi/Metadata/SearchMatchFieldOptions.html +140 -0
- data/docs/DropboxApi/Metadata/SearchMatchTypeV2.html +244 -0
- data/docs/DropboxApi/Metadata/SearchMatchV2.html +216 -0
- data/docs/DropboxApi/Metadata/SearchOptions.html +140 -0
- data/docs/DropboxApi/Metadata/SearchOrderBy.html +242 -0
- data/docs/DropboxApi/Metadata/SharedFolder.html +6 -6
- data/docs/DropboxApi/Metadata/SharedFolderPolicy.html +6 -6
- data/docs/DropboxApi/Metadata/SharedLink.html +18 -18
- data/docs/DropboxApi/Metadata/SharedLinkMetadata.html +10 -10
- data/docs/DropboxApi/Metadata/SpaceAllocation.html +6 -6
- data/docs/DropboxApi/Metadata/SpaceUsage.html +6 -6
- data/docs/DropboxApi/Metadata/Tag.html +14 -14
- data/docs/DropboxApi/Metadata/Team.html +6 -6
- data/docs/DropboxApi/Metadata/TeamMemberInfo.html +6 -6
- data/docs/DropboxApi/Metadata/TeamRootInfo.html +140 -0
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultData.html +6 -6
- data/docs/DropboxApi/Metadata/ThumbnailBatchResultEntry.html +11 -11
- data/docs/DropboxApi/Metadata/UploadSessionCursor.html +9 -9
- data/docs/DropboxApi/Metadata/UserRootInfo.html +140 -0
- data/docs/DropboxApi/Metadata/VideoMetadata.html +6 -6
- data/docs/DropboxApi/Metadata/WriteMode.html +21 -21
- data/docs/DropboxApi/Metadata.html +8 -8
- data/docs/DropboxApi/MiddleWare/DecodeResult.html +13 -13
- data/docs/DropboxApi/MiddleWare/PathRoot.html +412 -0
- data/docs/DropboxApi/MiddleWare/Stack.html +22 -22
- data/docs/DropboxApi/MiddleWare.html +8 -8
- data/docs/DropboxApi/OptionsValidator.html +10 -10
- data/docs/DropboxApi/ResultBuilder.html +30 -30
- data/docs/DropboxApi/Results/AddFileMemberResultList.html +10 -10
- data/docs/DropboxApi/Results/Base.html +11 -11
- data/docs/DropboxApi/Results/BasicAccountBatch.html +10 -10
- 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 +18 -18
- data/docs/DropboxApi/Results/GetTemporaryLinkResult.html +14 -14
- data/docs/DropboxApi/Results/GetThumbnailBatchResult.html +10 -10
- data/docs/DropboxApi/Results/ListFolderGetLatestCursorResult.html +10 -10
- data/docs/DropboxApi/Results/ListFolderLongpollResult.html +14 -14
- data/docs/DropboxApi/Results/ListFolderResult.html +18 -18
- data/docs/DropboxApi/Results/ListRevisionsResult.html +14 -14
- data/docs/DropboxApi/Results/ListSharedLinksResult.html +18 -18
- data/docs/DropboxApi/Results/RelocationBatchResult.html +241 -0
- data/docs/DropboxApi/Results/RelocationBatchResultEntry.html +226 -0
- data/docs/DropboxApi/Results/SaveCopyReferenceResult.html +10 -10
- data/docs/DropboxApi/Results/SaveUrlJobStatus.html +15 -15
- data/docs/DropboxApi/Results/SaveUrlResult.html +10 -10
- data/docs/DropboxApi/Results/Search/Match.html +18 -18
- data/docs/DropboxApi/Results/Search.html +6 -6
- data/docs/DropboxApi/Results/SearchResult.html +3 -3
- data/docs/DropboxApi/Results/SearchV2Result.html +368 -0
- data/docs/DropboxApi/Results/ShareFolderLaunch.html +12 -12
- data/docs/DropboxApi/Results/SharedFileMembers.html +22 -22
- data/docs/DropboxApi/Results/SharedFolderMembers.html +22 -22
- data/docs/DropboxApi/Results/UploadSessionStart.html +10 -10
- data/docs/DropboxApi/Results/VoidResult.html +6 -6
- data/docs/DropboxApi/Results.html +8 -8
- data/docs/DropboxApi.html +7 -7
- data/docs/DropboxScaffoldBuilder.html +269 -102
- data/docs/_index.html +261 -16
- data/docs/class_list.html +3 -3
- data/docs/css/common.css +3 -0
- data/docs/css/style.css +3 -2
- data/docs/file.README.html +134 -43
- data/docs/file.api_coverage.html +21 -21
- data/docs/file.rails_setup.html +10 -10
- data/docs/file_list.html +2 -2
- data/docs/frames.html +2 -2
- data/docs/index.html +134 -43
- data/docs/js/app.js +25 -3
- data/docs/method_list.html +598 -238
- data/docs/top-level-namespace.html +6 -6
- data/dropbox_api.gemspec +11 -16
- data/lib/dropbox_api/authenticator.rb +5 -8
- data/lib/dropbox_api/chunked_uploader.rb +2 -1
- data/lib/dropbox_api/client.rb +24 -2
- data/lib/dropbox_api/connection_builder.rb +39 -4
- data/lib/dropbox_api/endpoints/auth/token_revoke.rb +2 -1
- data/lib/dropbox_api/endpoints/base.rb +31 -5
- data/lib/dropbox_api/endpoints/content_download.rb +5 -7
- data/lib/dropbox_api/endpoints/content_upload.rb +3 -2
- 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/search_continue.rb +23 -0
- 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 +3 -2
- data/lib/dropbox_api/endpoints/rpc_content.rb +3 -2
- data/lib/dropbox_api/endpoints/rpc_notify.rb +4 -3
- 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/expired_access_token_error.rb +5 -0
- 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 +8 -1
- 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/namespace_id.rb +10 -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/root_info.rb +32 -0
- 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/team_root_info.rb +8 -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/user_root_info.rb +7 -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/path_root.rb +35 -0
- 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 +23 -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 +38 -6
- 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 +84 -93
- data/CHANGES.md +0 -7
- data/lib/dropbox_api/results/search_result.rb +0 -22
data/docs/index.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "README";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -57,11 +57,11 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'><h1>DropboxApi</h1>
|
60
|
+
<div id="content"><div id='filecontents'><h1 id="dropboxapi">DropboxApi</h1>
|
61
61
|
|
62
62
|
<p>Library for communicating with Dropbox API v2.</p>
|
63
63
|
|
64
|
-
<h2>Installation</h2>
|
64
|
+
<h2 id="installation">Installation</h2>
|
65
65
|
|
66
66
|
<p>Add this line to your application's Gemfile:</p>
|
67
67
|
|
@@ -78,7 +78,7 @@
|
|
78
78
|
<pre class="code ruby"><code class="ruby">$ gem install dropbox_api
|
79
79
|
</code></pre>
|
80
80
|
|
81
|
-
<h2>Documentation</h2>
|
81
|
+
<h2 id="documentation">Documentation</h2>
|
82
82
|
|
83
83
|
<p>Please, refer to this gem's custom <a href="http://jesus.github.io/dropbox_api">Dropbox API
|
84
84
|
documentation</a>.
|
@@ -96,9 +96,9 @@ an example of its usage.</li>
|
|
96
96
|
use them.</li>
|
97
97
|
</ul>
|
98
98
|
|
99
|
-
<h2>Basic set up</h2>
|
99
|
+
<h2 id="basic-set-up">Basic set up</h2>
|
100
100
|
|
101
|
-
<h3>Authorize your application</h3>
|
101
|
+
<h3 id="authorize-your-application">Authorize your application</h3>
|
102
102
|
|
103
103
|
<p>Dropbox uses OAuth, in order to use this library from your application you'll
|
104
104
|
have to get an authorization code.</p>
|
@@ -116,43 +116,111 @@ have to get an authorization code.</p>
|
|
116
116
|
<span class='comment'>#=> #<DropboxApi::Client ...>
|
117
117
|
</span></code></pre>
|
118
118
|
|
119
|
-
<p>
|
120
|
-
|
119
|
+
<p>The official documentation on the process to get an authorization code is
|
120
|
+
<a href="https://developers.dropbox.com/es-es/oauth-guide#implementing-oauth">here</a>,
|
121
|
+
it describes the two options listed below.</p>
|
121
122
|
|
122
|
-
<h4>Option A: Get your access token from the website</h4>
|
123
|
+
<h4 id="option-a-get-your-access-token-from-the-website">Option A: Get your access token from the website</h4>
|
123
124
|
|
124
|
-
<p>
|
125
|
-
|
126
|
-
<em>My apps</em>
|
127
|
-
haven't done so yet
|
125
|
+
<p>For a quick test, you can obtain an access token from the App Console in
|
126
|
+
<a href="https://www.dropbox.com/developers/">Dropbox's website</a>. Select from
|
127
|
+
<em>My apps</em> your application, you may need to create one if you
|
128
|
+
haven't done so yet. Under your application settings, find section
|
129
|
+
<em>OAuth 2</em>, there is a button to generate an access token.</p>
|
128
130
|
|
129
|
-
<
|
130
|
-
to generate an access token.</p>
|
131
|
+
<h4 id="option-b-oauth2-code-flow">Option B: OAuth2 Code Flow</h4>
|
131
132
|
|
132
|
-
<
|
133
|
+
<p>This is typically what you will use in production, you can obtain an
|
134
|
+
authorization code with a 3-step process:</p>
|
133
135
|
|
134
|
-
<
|
135
|
-
|
136
|
-
<
|
137
|
-
<span class='id identifier rubyid_authenticator'>authenticator</span><span class='period'>.</span><span class='id identifier rubyid_authorize_url'>authorize_url</span> <span class='comment'>#=> "https://www.dropbox.com/..."
|
136
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'># 1. Get an authorization URL.
|
137
|
+
</span><span class='id identifier rubyid_authenticator'>authenticator</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Authenticator.html" title="DropboxApi::Authenticator (class)">Authenticator</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Authenticator.html#initialize-instance_method" title="DropboxApi::Authenticator#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='const'>CLIENT_ID</span><span class='comma'>,</span> <span class='const'>CLIENT_SECRET</span><span class='rparen'>)</span>
|
138
|
+
<span class='id identifier rubyid_authenticator'>authenticator</span><span class='period'>.</span><span class='id identifier rubyid_auth_code'>auth_code</span><span class='period'>.</span><span class='id identifier rubyid_authorize_url'>authorize_url</span> <span class='comment'>#=> "https://www.dropbox.com/..."
|
138
139
|
</span>
|
139
|
-
<span class='comment'>#
|
140
|
-
</span><span class='comment'>#
|
140
|
+
<span class='comment'># 2. Log into Dropbox and authorize your app. You need to open the
|
141
|
+
</span><span class='comment'># authorization URL in your browser.
|
141
142
|
</span>
|
142
|
-
<span class='
|
143
|
-
</span><span class='
|
144
|
-
</span><span class='
|
145
|
-
</span
|
143
|
+
<span class='comment'># 3. Exchange the authorization code for a reusable access token (not visible
|
144
|
+
</span><span class='comment'># to the user).
|
145
|
+
</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_authenticator'>authenticator</span><span class='period'>.</span><span class='id identifier rubyid_auth_code'>auth_code</span><span class='period'>.</span><span class='id identifier rubyid_get_token'>get_token</span><span class='lparen'>(</span><span class='const'>CODE</span><span class='rparen'>)</span> <span class='comment'>#=> #<OAuth2::AccessToken ...>`
|
146
|
+
</span><span class='id identifier rubyid_access_token'>access_token</span><span class='period'>.</span><span class='id identifier rubyid_token'>token</span> <span class='comment'>#=> "VofXAX8D..."
|
147
|
+
</span>
|
148
|
+
<span class='comment'># Keep this token, you'll need it to initialize a `DropboxApi::Client` object:
|
149
|
+
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Client.html" title="DropboxApi::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Client.html#initialize-instance_method" title="DropboxApi::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>access_token:</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='rparen'>)</span>
|
146
150
|
|
147
|
-
<
|
151
|
+
<span class='comment'># For backwards compatibility, the following also works:
|
152
|
+
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Client.html" title="DropboxApi::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Client.html#initialize-instance_method" title="DropboxApi::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_access_token'>access_token</span><span class='period'>.</span><span class='id identifier rubyid_token'>token</span><span class='rparen'>)</span>
|
153
|
+
</code></pre>
|
148
154
|
|
149
|
-
<
|
150
|
-
Dropbox's <a href="https://www.dropbox.com/developers/reference/oauth-guide#oauth-2-on-the-web">OAuth guide</a>.</p>
|
155
|
+
<h5 id="integration-with-rails">Integration with Rails</h5>
|
151
156
|
|
152
157
|
<p>If you have a Rails application, you might be interested in this <a href="http://jesus.github.io/dropbox_api/file.rails_setup.html">setup
|
153
158
|
guide</a>.</p>
|
154
159
|
|
155
|
-
<
|
160
|
+
<h5 id="using-refresh-tokens">Using refresh tokens</h5>
|
161
|
+
|
162
|
+
<p>Access tokens are short-lived by default (as of September 30th, 2021),
|
163
|
+
applications that require long-lived access to the API without additional
|
164
|
+
interaction with the user should use refresh tokens.</p>
|
165
|
+
|
166
|
+
<p>The process is similar but a token refresh might seamlessly occur as you
|
167
|
+
perform API calls. When this happens you'll need to store the
|
168
|
+
new token hash if you want to continue using this session, you can use the
|
169
|
+
<code>on_token_refreshed</code> callback to do this.</p>
|
170
|
+
|
171
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'># 1. Get an authorization URL, requesting offline access type.
|
172
|
+
</span><span class='id identifier rubyid_authenticator'>authenticator</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Authenticator.html" title="DropboxApi::Authenticator (class)">Authenticator</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Authenticator.html#initialize-instance_method" title="DropboxApi::Authenticator#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='const'>CLIENT_ID</span><span class='comma'>,</span> <span class='const'>CLIENT_SECRET</span><span class='rparen'>)</span>
|
173
|
+
<span class='id identifier rubyid_authenticator'>authenticator</span><span class='period'>.</span><span class='id identifier rubyid_auth_code'>auth_code</span><span class='period'>.</span><span class='id identifier rubyid_authorize_url'>authorize_url</span><span class='lparen'>(</span><span class='label'>token_access_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>offline</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
174
|
+
|
175
|
+
<span class='comment'># 2. Log into Dropbox and authorize your app. You need to open the
|
176
|
+
</span><span class='comment'># authorization URL in your browser.
|
177
|
+
</span>
|
178
|
+
<span class='comment'># 3. Exchange the authorization code for a reusable access token
|
179
|
+
</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_authenticator'>authenticator</span><span class='period'>.</span><span class='id identifier rubyid_auth_code'>auth_code</span><span class='period'>.</span><span class='id identifier rubyid_get_token'>get_token</span><span class='lparen'>(</span><span class='const'>CODE</span><span class='rparen'>)</span> <span class='comment'>#=> #<OAuth2::AccessToken ...>`
|
180
|
+
</span>
|
181
|
+
<span class='comment'># You can now use the access token to initialize a DropboxApi::Client, you
|
182
|
+
</span><span class='comment'># should also provide a callback function to store the updated access token
|
183
|
+
</span><span class='comment'># whenever it's refreshed.
|
184
|
+
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Client.html" title="DropboxApi::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Client.html#initialize-instance_method" title="DropboxApi::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
185
|
+
<span class='label'>access_token:</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span>
|
186
|
+
<span class='label'>on_token_refreshed:</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_new_token_hash'>new_token_hash</span><span class='op'>|</span>
|
187
|
+
<span class='comment'># token_hash is a serializable Hash, something like this:
|
188
|
+
</span> <span class='comment'># {
|
189
|
+
</span> <span class='comment'># "uid"=>"440",
|
190
|
+
</span> <span class='comment'># "token_type"=>"bearer",
|
191
|
+
</span> <span class='comment'># "scope"=>"account_info.read account_info.write...",
|
192
|
+
</span> <span class='comment'># "account_id"=>"dbid:AABOLtA1rT6rRK4vajKZ...",
|
193
|
+
</span> <span class='comment'># :access_token=>"sl.A5Ez_CBsqJILhDawHlmXSoZEhLZ4nuLFVRs6AJ...",
|
194
|
+
</span> <span class='comment'># :refresh_token=>"iMg4Me_oKYUAAAAAAAAAAapQixCgwfXOxuubCuK_...",
|
195
|
+
</span> <span class='comment'># :expires_at=>1632948328
|
196
|
+
</span> <span class='comment'># }
|
197
|
+
</span> <span class='const'>SomewhereSafe</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_new_token_hash'>new_token_hash</span><span class='rparen'>)</span>
|
198
|
+
<span class='rbrace'>}</span>
|
199
|
+
<span class='rparen'>)</span>
|
200
|
+
</code></pre>
|
201
|
+
|
202
|
+
<p>Once you've gone through the process above, you can skip the steps that require
|
203
|
+
user interaction in subsequent initializations of <code>DropboxApi::Client</code>. For
|
204
|
+
example:</p>
|
205
|
+
|
206
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'># 1. Initialize an authenticator
|
207
|
+
</span><span class='id identifier rubyid_authenticator'>authenticator</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Authenticator.html" title="DropboxApi::Authenticator (class)">Authenticator</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Authenticator.html#initialize-instance_method" title="DropboxApi::Authenticator#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='const'>CLIENT_ID</span><span class='comma'>,</span> <span class='const'>CLIENT_SECRET</span><span class='rparen'>)</span>
|
208
|
+
|
209
|
+
<span class='comment'># 2. Retrieve the token hash you previously stored somewhere safe, you can use
|
210
|
+
</span><span class='comment'># it to build a new access token.
|
211
|
+
</span><span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='const'>OAuth2</span><span class='op'>::</span><span class='const'>AccessToken</span><span class='period'>.</span><span class='id identifier rubyid_from_hash'>from_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_authenticator'>authenticator</span><span class='comma'>,</span> <span class='id identifier rubyid_token_hash'>token_hash</span><span class='rparen'>)</span>
|
212
|
+
|
213
|
+
<span class='comment'># 3. You now have an access token, so you can initialize a client like you
|
214
|
+
</span><span class='comment'># would normally:
|
215
|
+
</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Client.html" title="DropboxApi::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Client.html#initialize-instance_method" title="DropboxApi::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span>
|
216
|
+
<span class='label'>access_token:</span> <span class='id identifier rubyid_access_token'>access_token</span><span class='comma'>,</span>
|
217
|
+
<span class='label'>on_token_refreshed:</span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_new_token_hash'>new_token_hash</span><span class='op'>|</span>
|
218
|
+
<span class='const'>SomewhereSafe</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_new_token_hash'>new_token_hash</span><span class='rparen'>)</span>
|
219
|
+
<span class='rbrace'>}</span>
|
220
|
+
<span class='rparen'>)</span>
|
221
|
+
</code></pre>
|
222
|
+
|
223
|
+
<h3 id="performing-api-calls">Performing API calls</h3>
|
156
224
|
|
157
225
|
<p>Once you've initialized a client, for example:</p>
|
158
226
|
|
@@ -174,7 +242,7 @@ guide</a>.</p>
|
|
174
242
|
perform API calls. You can check the class' documentation to find
|
175
243
|
<a href="http://jesus.github.io/dropbox_api/DropboxApi/Client.html">all available endpoints</a>.</p>
|
176
244
|
|
177
|
-
<h3>Large file uploads</h3>
|
245
|
+
<h3 id="large-file-uploads">Large file uploads</h3>
|
178
246
|
|
179
247
|
<p>If you need to upload files larger than 150MB the default <code>#upload</code> endpoint
|
180
248
|
won't work. Instead, you need to start a upload session and upload
|
@@ -194,21 +262,39 @@ example:</p>
|
|
194
262
|
<a href="http://www.xuuso.com/dropbox_api/DropboxApi/Client.html#upload_by_chunks-instance_method">method documentation</a>
|
195
263
|
to find out all available options.</p>
|
196
264
|
|
197
|
-
<
|
265
|
+
<h3 id="accessing-team-folders">Accessing Team Folders</h3>
|
266
|
+
|
267
|
+
<p>In order to access your team scope you need to add the namespace_id to you request headers.
|
268
|
+
This can be done using the middlewere layer as per the below:</p>
|
269
|
+
|
270
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DropboxApi.html" title="DropboxApi (module)">DropboxApi</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="DropboxApi/Client.html" title="DropboxApi::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DropboxApi/Client.html#initialize-instance_method" title="DropboxApi::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>VofXAX8D...</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
271
|
+
<span class='comment'>#=> #<DropboxApi::Client ...>
|
272
|
+
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_namespace_id'>namespace_id</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get_current_account'>get_current_account</span><span class='period'>.</span><span class='id identifier rubyid_root_info'>root_info</span><span class='period'>.</span><span class='id identifier rubyid_root_namespace_id'>root_namespace_id</span>
|
273
|
+
|
274
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_list_folder'>list_folder</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
275
|
+
<span class='comment'>#=> Now returns the team folders
|
276
|
+
</span></code></pre>
|
277
|
+
|
278
|
+
<p>You could unset the namespace ID at any point afterwards with just:</p>
|
279
|
+
|
280
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_namespace_id'>namespace_id</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
281
|
+
</code></pre>
|
282
|
+
|
283
|
+
<h2 id="dependencies">Dependencies</h2>
|
198
284
|
|
199
285
|
<p>This gem depends on
|
200
286
|
<a href="https://github.com/oauth-xx/oauth2">oauth2</a>
|
201
287
|
and
|
202
288
|
<a href="https://github.com/lostisland/faraday">faraday</a>.</p>
|
203
289
|
|
204
|
-
<p>It has official support for Ruby versions <code>
|
290
|
+
<p>It has official support for Ruby versions <code>2.x</code>.</p>
|
205
291
|
|
206
|
-
<h2>Development</h2>
|
292
|
+
<h2 id="development">Development</h2>
|
207
293
|
|
208
294
|
<p>After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run
|
209
295
|
<code>bin/console</code> for an interactive prompt that will allow you to experiment.</p>
|
210
296
|
|
211
|
-
<h3>Testing</h3>
|
297
|
+
<h3 id="testing">Testing</h3>
|
212
298
|
|
213
299
|
<p>I recommend you to use a test account other than your main one.</p>
|
214
300
|
|
@@ -224,7 +310,12 @@ will pass. If it doesn't exist you may need to write it yourself, check
|
|
224
310
|
the <code>DropboxScaffoldBuilder</code> class to find all existing scaffold builders.</p>
|
225
311
|
|
226
312
|
<pre class="code text"><code class="text">DROPBOX_OAUTH_BEARER=YOUR_AUTH_BEARER rake test:build_scaffold[list_folder]
|
227
|
-
</code></pre
|
313
|
+
</code></pre>
|
314
|
+
|
315
|
+
<p>Note that you'll have to type <code>rake test:build_scaffold\[list_folder\]</code>
|
316
|
+
if you use <code>zsh</code>.</p>
|
317
|
+
|
318
|
+
<p>You can build all available scaffolds with just <code>rake test:build_scaffold</code>.</p></li>
|
228
319
|
<li><p>Run the tests and the cassettes will be written:</p>
|
229
320
|
|
230
321
|
<pre class="code text"><code class="text">DROPBOX_OAUTH_BEARER=YOUR_AUTH_BEARER rspec spec/endpoints/files/list_folder_spec.rb
|
@@ -235,11 +326,11 @@ the <code>DropboxScaffoldBuilder</code> class to find all existing scaffold buil
|
|
235
326
|
been filtered. However, you may want to double check before pushing your
|
236
327
|
updates to Github.</p>
|
237
328
|
|
238
|
-
<p>Tip:
|
329
|
+
<p>Tip: you can simply run <code>export DROPBOX_OAUTH_BEARER=YOUR_AUTH_BEARER</code> at
|
239
330
|
the beginning of your work session so you don't need to prefix it in every
|
240
331
|
command line.</p>
|
241
332
|
|
242
|
-
<h2>Contributing</h2>
|
333
|
+
<h2 id="contributing">Contributing</h2>
|
243
334
|
|
244
335
|
<p>Any help will be much appreciated. The easiest way to help is to implement one
|
245
336
|
or more of the <a href="http://jesus.github.io/dropbox_api/file.api_coverage.html">endpoints that are still pending</a>. To see how the
|
@@ -247,9 +338,9 @@ endpoints are implemented, check out the <code>lib/dropbox_api/endpoints</code>
|
|
247
338
|
</div></div>
|
248
339
|
|
249
340
|
<div id="footer">
|
250
|
-
Generated on
|
341
|
+
Generated on Wed Sep 29 23:44:24 2021 by
|
251
342
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
252
|
-
0.9.
|
343
|
+
0.9.26 (ruby-2.6.5).
|
253
344
|
</div>
|
254
345
|
|
255
346
|
</div>
|
data/docs/js/app.js
CHANGED
@@ -171,6 +171,7 @@ function generateTOC() {
|
|
171
171
|
var counter = 0;
|
172
172
|
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
173
173
|
var i;
|
174
|
+
var curli;
|
174
175
|
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
175
176
|
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
176
177
|
var lastTag = parseInt(tags[0][1], 10);
|
@@ -190,15 +191,25 @@ function generateTOC() {
|
|
190
191
|
}
|
191
192
|
if (thisTag > lastTag) {
|
192
193
|
for (i = 0; i < thisTag - lastTag; i++) {
|
193
|
-
|
194
|
+
if ( typeof(curli) == "undefined" ) {
|
195
|
+
curli = $('<li/>');
|
196
|
+
toc.append(curli);
|
197
|
+
}
|
198
|
+
toc = $('<ol/>');
|
199
|
+
curli.append(toc);
|
200
|
+
curli = undefined;
|
194
201
|
}
|
195
202
|
}
|
196
203
|
if (thisTag < lastTag) {
|
197
|
-
for (i = 0; i < lastTag - thisTag; i++)
|
204
|
+
for (i = 0; i < lastTag - thisTag; i++) {
|
205
|
+
toc = toc.parent();
|
206
|
+
toc = toc.parent();
|
207
|
+
}
|
198
208
|
}
|
199
209
|
var title = $(this).attr('toc-title');
|
200
210
|
if (typeof(title) == "undefined") title = $(this).text();
|
201
|
-
|
211
|
+
curli =$('<li><a href="#' + this.id + '">' + title + '</a></li>');
|
212
|
+
toc.append(curli);
|
202
213
|
lastTag = thisTag;
|
203
214
|
});
|
204
215
|
if (!show) return;
|
@@ -275,6 +286,16 @@ function mainFocus() {
|
|
275
286
|
setTimeout(function() { $('#main').focus(); }, 10);
|
276
287
|
}
|
277
288
|
|
289
|
+
function navigationChange() {
|
290
|
+
// This works around the broken anchor navigation with the YARD template.
|
291
|
+
window.onpopstate = function() {
|
292
|
+
var hash = window.location.hash;
|
293
|
+
if (hash !== '' && $(hash)[0]) {
|
294
|
+
$(hash)[0].scrollIntoView();
|
295
|
+
}
|
296
|
+
};
|
297
|
+
}
|
298
|
+
|
278
299
|
$(document).ready(function() {
|
279
300
|
navResizer();
|
280
301
|
navExpander();
|
@@ -287,6 +308,7 @@ $(document).ready(function() {
|
|
287
308
|
constantSummaryToggle();
|
288
309
|
generateTOC();
|
289
310
|
mainFocus();
|
311
|
+
navigationChange();
|
290
312
|
});
|
291
313
|
|
292
314
|
})();
|