dropbox_api 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +113 -22
  3. data/docs/DropboxApi/Authenticator.html +12 -12
  4. data/docs/DropboxApi/ChunkedUploader.html +20 -20
  5. data/docs/DropboxApi/Client.html +1673 -906
  6. data/docs/DropboxApi/ConnectionBuilder.html +16 -16
  7. data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +10 -10
  8. data/docs/DropboxApi/Endpoints/Auth.html +6 -6
  9. data/docs/DropboxApi/Endpoints/Base.html +9 -9
  10. data/docs/DropboxApi/Endpoints/ContentDownload.html +19 -19
  11. data/docs/DropboxApi/Endpoints/ContentUpload.html +17 -17
  12. data/docs/DropboxApi/Endpoints/Files/Copy.html +12 -12
  13. data/docs/DropboxApi/Endpoints/Files/CopyBatch.html +11 -11
  14. data/docs/DropboxApi/Endpoints/Files/CopyBatchCheck.html +11 -11
  15. data/docs/DropboxApi/Endpoints/Files/CopyReferenceGet.html +11 -11
  16. data/docs/DropboxApi/Endpoints/Files/CopyReferenceSave.html +12 -12
  17. data/docs/DropboxApi/Endpoints/Files/CreateFileRequest.html +12 -12
  18. data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +11 -11
  19. data/docs/DropboxApi/Endpoints/Files/CreateFolderBatch.html +11 -11
  20. data/docs/DropboxApi/Endpoints/Files/CreateFolderBatchCheck.html +11 -11
  21. data/docs/DropboxApi/Endpoints/Files/Delete.html +11 -11
  22. data/docs/DropboxApi/Endpoints/Files/DeleteBatch.html +11 -11
  23. data/docs/DropboxApi/Endpoints/Files/DeleteBatchCheck.html +11 -11
  24. data/docs/DropboxApi/Endpoints/Files/Download.html +11 -11
  25. data/docs/DropboxApi/Endpoints/Files/GetMetadata.html +11 -11
  26. data/docs/DropboxApi/Endpoints/Files/GetPreview.html +11 -11
  27. data/docs/DropboxApi/Endpoints/Files/GetTemporaryLink.html +11 -11
  28. data/docs/DropboxApi/Endpoints/Files/GetThumbnail.html +11 -11
  29. data/docs/DropboxApi/Endpoints/Files/GetThumbnailBatch.html +15 -15
  30. data/docs/DropboxApi/Endpoints/Files/ListFolder.html +11 -11
  31. data/docs/DropboxApi/Endpoints/Files/ListFolderContinue.html +11 -11
  32. data/docs/DropboxApi/Endpoints/Files/ListFolderGetLatestCursor.html +10 -10
  33. data/docs/DropboxApi/Endpoints/Files/ListFolderLongpoll.html +11 -11
  34. data/docs/DropboxApi/Endpoints/Files/ListRevisions.html +11 -11
  35. data/docs/DropboxApi/Endpoints/Files/Move.html +12 -12
  36. data/docs/DropboxApi/Endpoints/Files/PermanentlyDelete.html +11 -11
  37. data/docs/DropboxApi/Endpoints/Files/Restore.html +12 -12
  38. data/docs/DropboxApi/Endpoints/Files/SaveUrl.html +12 -12
  39. data/docs/DropboxApi/Endpoints/Files/SaveUrlCheckJobStatus.html +11 -11
  40. data/docs/DropboxApi/Endpoints/Files/Search.html +48 -96
  41. data/docs/DropboxApi/Endpoints/Files/Upload.html +10 -10
  42. data/docs/DropboxApi/Endpoints/Files/UploadSessionAppendV2.html +11 -11
  43. data/docs/DropboxApi/Endpoints/Files/UploadSessionFinish.html +12 -12
  44. data/docs/DropboxApi/Endpoints/Files/UploadSessionStart.html +12 -12
  45. data/docs/DropboxApi/Endpoints/Files.html +6 -6
  46. data/docs/DropboxApi/Endpoints/Rpc.html +17 -17
  47. data/docs/DropboxApi/Endpoints/RpcContent.html +11 -11
  48. data/docs/DropboxApi/Endpoints/RpcNotify.html +11 -11
  49. data/docs/DropboxApi/Endpoints/Sharing/AddFileMember.html +12 -12
  50. data/docs/DropboxApi/Endpoints/Sharing/AddFolderMember.html +12 -12
  51. data/docs/DropboxApi/Endpoints/Sharing/CreateSharedLinkWithSettings.html +12 -12
  52. data/docs/DropboxApi/Endpoints/Sharing/GetSharedLinkMetadata.html +11 -11
  53. data/docs/DropboxApi/Endpoints/Sharing/ListFileMembers.html +12 -12
  54. data/docs/DropboxApi/Endpoints/Sharing/ListFolderMembers.html +12 -12
  55. data/docs/DropboxApi/Endpoints/Sharing/ListSharedLinks.html +10 -10
  56. data/docs/DropboxApi/Endpoints/Sharing/RevokeSharedLink.html +11 -11
  57. data/docs/DropboxApi/Endpoints/Sharing/ShareFolder.html +11 -11
  58. data/docs/DropboxApi/Endpoints/Sharing/UnshareFile.html +11 -11
  59. data/docs/DropboxApi/Endpoints/Sharing.html +6 -6
  60. data/docs/DropboxApi/Endpoints/Users/GetAccount.html +11 -11
  61. data/docs/DropboxApi/Endpoints/Users/GetAccountBatch.html +11 -11
  62. data/docs/DropboxApi/Endpoints/Users/GetCurrentAccount.html +10 -10
  63. data/docs/DropboxApi/Endpoints/Users/GetSpaceUsage.html +10 -10
  64. data/docs/DropboxApi/Endpoints/Users.html +6 -6
  65. data/docs/DropboxApi/Endpoints.html +6 -6
  66. data/docs/DropboxApi/Errors/AddFileMemberError.html +10 -10
  67. data/docs/DropboxApi/Errors/AddFolderMemberError.html +16 -16
  68. data/docs/DropboxApi/Errors/AddMemberSelectorError.html +11 -11
  69. data/docs/DropboxApi/Errors/AlreadySharedError.html +9 -9
  70. data/docs/DropboxApi/Errors/BadPathError.html +6 -6
  71. data/docs/DropboxApi/Errors/BasicError.html +17 -17
  72. data/docs/DropboxApi/Errors/CantCopySharedFolderError.html +6 -6
  73. data/docs/DropboxApi/Errors/CantMoveFolderIntoItselfError.html +6 -6
  74. data/docs/DropboxApi/Errors/CantNestSharedFolderError.html +6 -6
  75. data/docs/DropboxApi/Errors/CantShareOutsideTeamError.html +6 -6
  76. data/docs/DropboxApi/Errors/ContainsSharedFolderError.html +6 -6
  77. data/docs/DropboxApi/Errors/ConversionError.html +6 -6
  78. data/docs/DropboxApi/Errors/CreateFileRequestError.html +6 -6
  79. data/docs/DropboxApi/Errors/CreateFolderBatchError.html +7 -7
  80. data/docs/DropboxApi/Errors/CreateFolderError.html +7 -7
  81. data/docs/DropboxApi/Errors/CreateSharedLinkWithSettingsError.html +11 -11
  82. data/docs/DropboxApi/Errors/CursorClosedError.html +6 -6
  83. data/docs/DropboxApi/Errors/CursorNotClosedError.html +6 -6
  84. data/docs/DropboxApi/Errors/DeleteError.html +9 -9
  85. data/docs/DropboxApi/Errors/DisallowedNameError.html +6 -6
  86. data/docs/DropboxApi/Errors/DisallowedSharedLinkPolicyError.html +6 -6
  87. data/docs/DropboxApi/Errors/DownloadError.html +7 -7
  88. data/docs/DropboxApi/Errors/DownloadFailedError.html +6 -6
  89. data/docs/DropboxApi/Errors/EmailUnverifiedError.html +6 -6
  90. data/docs/DropboxApi/Errors/FileAncestorConflictError.html +6 -6
  91. data/docs/DropboxApi/Errors/FileConflictError.html +6 -6
  92. data/docs/DropboxApi/Errors/FileMemberActionError.html +10 -10
  93. data/docs/DropboxApi/Errors/FolderConflictError.html +6 -6
  94. data/docs/DropboxApi/Errors/GetAccountError.html +7 -7
  95. data/docs/DropboxApi/Errors/GetCopyReferenceError.html +7 -7
  96. data/docs/DropboxApi/Errors/GetMetadataError.html +7 -7
  97. data/docs/DropboxApi/Errors/GroupDeletedError.html +6 -6
  98. data/docs/DropboxApi/Errors/GroupNotOnTeamError.html +6 -6
  99. data/docs/DropboxApi/Errors/HttpError.html +6 -6
  100. data/docs/DropboxApi/Errors/InProgressError.html +6 -6
  101. data/docs/DropboxApi/Errors/InsideAppFolderError.html +6 -6
  102. data/docs/DropboxApi/Errors/InsideOsxPackageError.html +6 -6
  103. data/docs/DropboxApi/Errors/InsidePublicFolderError.html +6 -6
  104. data/docs/DropboxApi/Errors/InsideSharedFolderError.html +6 -6
  105. data/docs/DropboxApi/Errors/InsufficientPlanError.html +6 -6
  106. data/docs/DropboxApi/Errors/InsufficientSpaceError.html +6 -6
  107. data/docs/DropboxApi/Errors/InternalError.html +6 -6
  108. data/docs/DropboxApi/Errors/InvalidCommentError.html +6 -6
  109. data/docs/DropboxApi/Errors/InvalidCopyReferenceError.html +6 -6
  110. data/docs/DropboxApi/Errors/InvalidCursorError.html +6 -6
  111. data/docs/DropboxApi/Errors/InvalidDropboxIdError.html +6 -6
  112. data/docs/DropboxApi/Errors/InvalidEmailError.html +6 -6
  113. data/docs/DropboxApi/Errors/InvalidFileError.html +6 -6
  114. data/docs/DropboxApi/Errors/InvalidIdError.html +6 -6
  115. data/docs/DropboxApi/Errors/InvalidMemberError.html +6 -6
  116. data/docs/DropboxApi/Errors/InvalidPathError.html +6 -6
  117. data/docs/DropboxApi/Errors/InvalidRevisionError.html +6 -6
  118. data/docs/DropboxApi/Errors/InvalidSettingsError.html +6 -6
  119. data/docs/DropboxApi/Errors/InvalidUrlError.html +6 -6
  120. data/docs/DropboxApi/Errors/IsAppFolderError.html +6 -6
  121. data/docs/DropboxApi/Errors/IsFileError.html +6 -6
  122. data/docs/DropboxApi/Errors/IsFolderError.html +6 -6
  123. data/docs/DropboxApi/Errors/IsOsxPackageError.html +6 -6
  124. data/docs/DropboxApi/Errors/IsPublicFolderError.html +6 -6
  125. data/docs/DropboxApi/Errors/ListFolderContinueError.html +8 -8
  126. data/docs/DropboxApi/Errors/ListFolderError.html +7 -7
  127. data/docs/DropboxApi/Errors/ListFolderLongpollError.html +7 -7
  128. data/docs/DropboxApi/Errors/ListRevisionsError.html +7 -7
  129. data/docs/DropboxApi/Errors/ListSharedLinksError.html +8 -8
  130. data/docs/DropboxApi/Errors/LookupError.html +11 -11
  131. data/docs/DropboxApi/Errors/MalformedPathError.html +6 -6
  132. data/docs/DropboxApi/Errors/NoAccountError.html +6 -6
  133. data/docs/DropboxApi/Errors/NoPermissionError.html +6 -6
  134. data/docs/DropboxApi/Errors/NoWritePermissionError.html +6 -6
  135. data/docs/DropboxApi/Errors/NotAMemberError.html +6 -6
  136. data/docs/DropboxApi/Errors/NotFileError.html +6 -6
  137. data/docs/DropboxApi/Errors/NotFolderError.html +6 -6
  138. data/docs/DropboxApi/Errors/NotFoundError.html +6 -6
  139. data/docs/DropboxApi/Errors/PollError.html +8 -8
  140. data/docs/DropboxApi/Errors/PreviewError.html +10 -10
  141. data/docs/DropboxApi/Errors/RateLimitError.html +6 -6
  142. data/docs/DropboxApi/Errors/RelocationBatchEntryError.html +9 -9
  143. data/docs/DropboxApi/Errors/RelocationError.html +13 -13
  144. data/docs/DropboxApi/Errors/RestoreError.html +9 -9
  145. data/docs/DropboxApi/Errors/RestrictedContentError.html +6 -6
  146. data/docs/DropboxApi/Errors/RevokeSharedLinkError.html +10 -10
  147. data/docs/DropboxApi/Errors/SaveCopyReferenceError.html +11 -11
  148. data/docs/DropboxApi/Errors/SaveUrlError.html +10 -10
  149. data/docs/DropboxApi/Errors/SearchError.html +7 -7
  150. data/docs/DropboxApi/Errors/SettingsError.html +8 -8
  151. data/docs/DropboxApi/Errors/ShareFolderError.html +11 -11
  152. data/docs/DropboxApi/Errors/SharePathError.html +17 -17
  153. data/docs/DropboxApi/Errors/SharedFolderAccessError.html +10 -10
  154. data/docs/DropboxApi/Errors/SharedLinkAccessDeniedError.html +6 -6
  155. data/docs/DropboxApi/Errors/SharedLinkAlreadyExistsError.html +6 -6
  156. data/docs/DropboxApi/Errors/SharedLinkError.html +9 -9
  157. data/docs/DropboxApi/Errors/SharedLinkMalformedError.html +6 -6
  158. data/docs/DropboxApi/Errors/SharedLinkNotFoundError.html +6 -6
  159. data/docs/DropboxApi/Errors/SharingFileAccessError.html +11 -11
  160. data/docs/DropboxApi/Errors/SharingUserError.html +7 -7
  161. data/docs/DropboxApi/Errors/TeamFolderError.html +6 -6
  162. data/docs/DropboxApi/Errors/TeamPolicyDisallowsMemberPolicyError.html +6 -6
  163. data/docs/DropboxApi/Errors/ThumbnailBatchError.html +7 -7
  164. data/docs/DropboxApi/Errors/ThumbnailError.html +10 -10
  165. data/docs/DropboxApi/Errors/TooManyFilesError.html +6 -6
  166. data/docs/DropboxApi/Errors/TooManyMembersError.html +6 -6
  167. data/docs/DropboxApi/Errors/TooManyPendingInvitesError.html +6 -6
  168. data/docs/DropboxApi/Errors/TooManyRequestsError.html +15 -15
  169. data/docs/DropboxApi/Errors/TooManySharedFolderTargetsError.html +6 -6
  170. data/docs/DropboxApi/Errors/TooManyWriteOperationsError.html +6 -6
  171. data/docs/DropboxApi/Errors/UnmountedError.html +6 -6
  172. data/docs/DropboxApi/Errors/UnshareFileError.html +8 -8
  173. data/docs/DropboxApi/Errors/UnsupportedContentError.html +6 -6
  174. data/docs/DropboxApi/Errors/UnsupportedExtensionError.html +6 -6
  175. data/docs/DropboxApi/Errors/UnsupportedImageError.html +6 -6
  176. data/docs/DropboxApi/Errors/UnsupportedLinkTypeError.html +6 -6
  177. data/docs/DropboxApi/Errors/UnverifiedDropboxId.html +6 -6
  178. data/docs/DropboxApi/Errors/UploadError.html +7 -7
  179. data/docs/DropboxApi/Errors/UploadSessionFinishError.html +9 -9
  180. data/docs/DropboxApi/Errors/UploadSessionLookupError.html +10 -10
  181. data/docs/DropboxApi/Errors/UploadSessionOffsetError.html +10 -10
  182. data/docs/DropboxApi/Errors/UploadWriteFailedError.html +7 -7
  183. data/docs/DropboxApi/Errors/WriteConflictError.html +9 -9
  184. data/docs/DropboxApi/Errors/WriteError.html +11 -11
  185. data/docs/DropboxApi/Errors.html +6 -6
  186. data/docs/DropboxApi/Metadata/AccessLevel.html +9 -9
  187. data/docs/DropboxApi/Metadata/AddFileMemberResult.html +6 -6
  188. data/docs/DropboxApi/Metadata/AddMember.html +11 -11
  189. data/docs/DropboxApi/Metadata/Base.html +24 -24
  190. data/docs/DropboxApi/Metadata/BasicAccount.html +6 -6
  191. data/docs/DropboxApi/Metadata/CommitInfo.html +9 -9
  192. data/docs/DropboxApi/Metadata/Deleted.html +6 -6
  193. data/docs/DropboxApi/Metadata/Dimensions.html +6 -6
  194. data/docs/DropboxApi/Metadata/Field.html +24 -20
  195. data/docs/DropboxApi/Metadata/File.html +10 -10
  196. data/docs/DropboxApi/Metadata/FileCategoriesList.html +205 -0
  197. data/docs/DropboxApi/Metadata/FileCategory.html +250 -0
  198. data/docs/DropboxApi/Metadata/FileExtensionsList.html +213 -0
  199. data/docs/DropboxApi/Metadata/FileLinkMetadata.html +6 -6
  200. data/docs/DropboxApi/Metadata/FileMemberAction.html +10 -10
  201. data/docs/DropboxApi/Metadata/FileRequest.html +6 -6
  202. data/docs/DropboxApi/Metadata/FileStatus.html +242 -0
  203. data/docs/DropboxApi/Metadata/Folder.html +10 -10
  204. data/docs/DropboxApi/Metadata/FolderLinkMetadata.html +6 -6
  205. data/docs/DropboxApi/Metadata/FolderSharingInfo.html +6 -6
  206. data/docs/DropboxApi/Metadata/LinkPermissions.html +6 -6
  207. data/docs/DropboxApi/Metadata/Location.html +6 -6
  208. data/docs/DropboxApi/Metadata/MediaInfo.html +9 -9
  209. data/docs/DropboxApi/Metadata/MediaMetadata.html +9 -9
  210. data/docs/DropboxApi/Metadata/Member.html +13 -13
  211. data/docs/DropboxApi/Metadata/MemberAction.html +9 -9
  212. data/docs/DropboxApi/Metadata/MemberActionList.html +9 -9
  213. data/docs/DropboxApi/Metadata/MemberPermission.html +6 -6
  214. data/docs/DropboxApi/Metadata/MemberPermissionList.html +10 -10
  215. data/docs/DropboxApi/Metadata/MetadataV2.html +140 -0
  216. data/docs/DropboxApi/Metadata/Name.html +6 -6
  217. data/docs/DropboxApi/Metadata/ParentFolderAccessInfo.html +6 -6
  218. data/docs/DropboxApi/Metadata/PhotoMetadata.html +6 -6
  219. data/docs/DropboxApi/Metadata/Resource.html +10 -10
  220. data/docs/DropboxApi/Metadata/SearchMatchFieldOptions.html +140 -0
  221. data/docs/DropboxApi/Metadata/SearchMatchTypeV2.html +244 -0
  222. data/docs/DropboxApi/Metadata/SearchMatchV2.html +216 -0
  223. data/docs/DropboxApi/Metadata/SearchOptions.html +140 -0
  224. data/docs/DropboxApi/Metadata/SearchOrderBy.html +242 -0
  225. data/docs/DropboxApi/Metadata/SharedFolder.html +6 -6
  226. data/docs/DropboxApi/Metadata/SharedFolderPolicy.html +6 -6
  227. data/docs/DropboxApi/Metadata/SharedLink.html +18 -18
  228. data/docs/DropboxApi/Metadata/SharedLinkMetadata.html +10 -10
  229. data/docs/DropboxApi/Metadata/SpaceAllocation.html +6 -6
  230. data/docs/DropboxApi/Metadata/SpaceUsage.html +6 -6
  231. data/docs/DropboxApi/Metadata/Tag.html +14 -14
  232. data/docs/DropboxApi/Metadata/Team.html +6 -6
  233. data/docs/DropboxApi/Metadata/TeamMemberInfo.html +6 -6
  234. data/docs/DropboxApi/Metadata/ThumbnailBatchResultData.html +6 -6
  235. data/docs/DropboxApi/Metadata/ThumbnailBatchResultEntry.html +11 -11
  236. data/docs/DropboxApi/Metadata/UploadSessionCursor.html +9 -9
  237. data/docs/DropboxApi/Metadata/VideoMetadata.html +6 -6
  238. data/docs/DropboxApi/Metadata/WriteMode.html +21 -21
  239. data/docs/DropboxApi/Metadata.html +8 -8
  240. data/docs/DropboxApi/MiddleWare/DecodeResult.html +13 -13
  241. data/docs/DropboxApi/MiddleWare/Stack.html +22 -22
  242. data/docs/DropboxApi/MiddleWare.html +6 -6
  243. data/docs/DropboxApi/OptionsValidator.html +9 -9
  244. data/docs/DropboxApi/ResultBuilder.html +30 -30
  245. data/docs/DropboxApi/Results/AddFileMemberResultList.html +10 -10
  246. data/docs/DropboxApi/Results/Base.html +11 -11
  247. data/docs/DropboxApi/Results/BasicAccountBatch.html +10 -10
  248. data/docs/DropboxApi/Results/CopyBatchResult.html +10 -10
  249. data/docs/DropboxApi/Results/CreateFolderBatchResult.html +13 -13
  250. data/docs/DropboxApi/Results/CreateFolderBatchResultEntry.html +9 -9
  251. data/docs/DropboxApi/Results/DeleteBatchResult.html +13 -13
  252. data/docs/DropboxApi/Results/DeleteBatchResultEntry.html +9 -9
  253. data/docs/DropboxApi/Results/GetCopyReferenceResult.html +18 -18
  254. data/docs/DropboxApi/Results/GetTemporaryLinkResult.html +14 -14
  255. data/docs/DropboxApi/Results/GetThumbnailBatchResult.html +10 -10
  256. data/docs/DropboxApi/Results/ListFolderGetLatestCursorResult.html +10 -10
  257. data/docs/DropboxApi/Results/ListFolderLongpollResult.html +14 -14
  258. data/docs/DropboxApi/Results/ListFolderResult.html +18 -18
  259. data/docs/DropboxApi/Results/ListRevisionsResult.html +14 -14
  260. data/docs/DropboxApi/Results/ListSharedLinksResult.html +18 -18
  261. data/docs/DropboxApi/Results/RelocationBatchResult.html +13 -13
  262. data/docs/DropboxApi/Results/RelocationBatchResultEntry.html +9 -9
  263. data/docs/DropboxApi/Results/SaveCopyReferenceResult.html +10 -10
  264. data/docs/DropboxApi/Results/SaveUrlJobStatus.html +15 -15
  265. data/docs/DropboxApi/Results/SaveUrlResult.html +10 -10
  266. data/docs/DropboxApi/Results/Search/Match.html +18 -18
  267. data/docs/DropboxApi/Results/Search.html +6 -6
  268. data/docs/DropboxApi/Results/SearchV2Result.html +368 -0
  269. data/docs/DropboxApi/Results/ShareFolderLaunch.html +12 -12
  270. data/docs/DropboxApi/Results/SharedFileMembers.html +22 -22
  271. data/docs/DropboxApi/Results/SharedFolderMembers.html +22 -22
  272. data/docs/DropboxApi/Results/UploadSessionStart.html +10 -10
  273. data/docs/DropboxApi/Results/VoidResult.html +6 -6
  274. data/docs/DropboxApi/Results.html +8 -8
  275. data/docs/DropboxApi.html +7 -7
  276. data/docs/DropboxScaffoldBuilder.html +220 -108
  277. data/docs/_index.html +86 -16
  278. data/docs/class_list.html +3 -3
  279. data/docs/css/common.css +3 -0
  280. data/docs/css/style.css +3 -2
  281. data/docs/file.README.html +28 -23
  282. data/docs/file.api_coverage.html +14 -14
  283. data/docs/file.rails_setup.html +10 -10
  284. data/docs/file_list.html +2 -2
  285. data/docs/frames.html +2 -2
  286. data/docs/index.html +28 -23
  287. data/docs/js/app.js +14 -3
  288. data/docs/method_list.html +338 -266
  289. data/docs/top-level-namespace.html +6 -6
  290. data/lib/dropbox_api/authenticator.rb +2 -6
  291. data/lib/dropbox_api/client.rb +23 -2
  292. data/lib/dropbox_api/connection_builder.rb +38 -4
  293. data/lib/dropbox_api/endpoints/base.rb +24 -1
  294. data/lib/dropbox_api/endpoints/content_download.rb +2 -2
  295. data/lib/dropbox_api/endpoints/content_upload.rb +2 -2
  296. data/lib/dropbox_api/endpoints/files/search_continue.rb +23 -0
  297. data/lib/dropbox_api/endpoints/rpc.rb +2 -2
  298. data/lib/dropbox_api/endpoints/rpc_content.rb +2 -2
  299. data/lib/dropbox_api/endpoints/rpc_notify.rb +2 -2
  300. data/lib/dropbox_api/errors/expired_access_token_error.rb +5 -0
  301. data/lib/dropbox_api/metadata/basic_account.rb +7 -1
  302. data/lib/dropbox_api/metadata/namespace_id.rb +10 -0
  303. data/lib/dropbox_api/metadata/root_info.rb +32 -0
  304. data/lib/dropbox_api/metadata/team_root_info.rb +8 -0
  305. data/lib/dropbox_api/metadata/user_root_info.rb +7 -0
  306. data/lib/dropbox_api/middleware/path_root.rb +35 -0
  307. data/lib/dropbox_api/results/search_v2_result.rb +2 -3
  308. data/lib/dropbox_api/version.rb +1 -1
  309. data/lib/dropbox_api.rb +10 -3
  310. metadata +21 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c59970ce358c1a706d47040336547ea3df770fe97194122011f5695d69a4bc9
4
- data.tar.gz: caff55f6ba1ae50d6487450c2f12ac2df2a72a2cf3573ce6d8610664de404012
3
+ metadata.gz: e61a99956b140b0c8b5fe982a62e1595f68f1f4b49033f023121792582121eba
4
+ data.tar.gz: bad01ce29cb518859008b0e71464a46cb452b348432ae8bc162e587834dee5f6
5
5
  SHA512:
6
- metadata.gz: 7fc4add7446cec7d25627719dffa3b293173c7ce02356d514c7ac49f17673207da670d563e63ba0bf2690376beec98325ce84fbb6843f4bedab0ec6ff1b000b9
7
- data.tar.gz: 4d2a098c291bc47d501ba90dcce05ae43e42ab77fa1c5fe8ad83d329aec3408d1ac987d2b931fbf25fe64a1f8c51584620306b06c32e9ebe7d5bf7c0a0efc6a1
6
+ metadata.gz: 02afaffdf0c402aa40233ee75742de02ebd9eb54f2bd962ca934c317abe29192ef846c159a0f2536bd35b2d1c319e0a9f0ddff6d0d260a9b76bf4886bc34e721
7
+ data.tar.gz: 5bf772b6b13e147323c932ec7abf731f6c846b1da43de3e763dd51a755e64776407b42565835896f2f6ff3af092b3f15b8eff75902bb50191801c2ea5946f695
data/README.md CHANGED
@@ -56,44 +56,115 @@ DropboxApi::Client.new
56
56
  #=> #<DropboxApi::Client ...>
57
57
  ```
58
58
 
59
- Note that setting an ENV variable is only a feasible choice if you're only
60
- using one account.
59
+ The official documentation on the process to get an authorization code is
60
+ [here](https://developers.dropbox.com/es-es/oauth-guide#implementing-oauth),
61
+ it describes the two options listed below.
61
62
 
62
- #### Option A: Get your access token from the website
63
63
 
64
- The easiest way to obtain an access token is to get it from the Dropbox website.
65
- You just need to log in to Dropbox and refer to the *developers* section, go to
66
- *My apps* and select your application, you may need to create one if you
67
- haven't done so yet.
64
+ #### Option A: Get your access token from the website
68
65
 
69
- Under your application settings, find section *OAuth 2*. You'll find a button
70
- to generate an access token.
66
+ For a quick test, you can obtain an access token from the App Console in
67
+ [Dropbox's website](https://www.dropbox.com/developers/). Select from
68
+ *My apps* your application, you may need to create one if you
69
+ haven't done so yet. Under your application settings, find section
70
+ *OAuth 2*, there is a button to generate an access token.
71
71
 
72
- #### Option B: Use `DropboxApi::Authenticator`
72
+ #### Option B: OAuth2 Code Flow
73
73
 
74
- You can obtain an authorization code with this library:
74
+ This is typically what you will use in production, you can obtain an
75
+ authorization code with a 3-step process:
75
76
 
76
77
  ```ruby
78
+ # 1. Get an authorization URL.
77
79
  authenticator = DropboxApi::Authenticator.new(CLIENT_ID, CLIENT_SECRET)
78
- authenticator.authorize_url #=> "https://www.dropbox.com/..."
80
+ authenticator.auth_code.authorize_url #=> "https://www.dropbox.com/..."
79
81
 
80
- # Now you need to open the authorization URL in your browser,
81
- # authorize the application and copy your code.
82
+ # 2. Log into Dropbox and authorize your app. You need to open the
83
+ # authorization URL in your browser.
82
84
 
83
- auth_bearer = authenticator.get_token(CODE) #=> #<OAuth2::AccessToken ...>`
84
- auth_bearer.token #=> "VofXAX8D..."
85
- # Keep this token, you'll need it to initialize a `DropboxApi::Client` object
86
- ```
85
+ # 3. Exchange the authorization code for a reusable access token (not visible
86
+ # to the user).
87
+ access_token = authenticator.auth_code.get_token(CODE) #=> #<OAuth2::AccessToken ...>`
88
+ access_token.token #=> "VofXAX8D..."
89
+
90
+ # Keep this token, you'll need it to initialize a `DropboxApi::Client` object:
91
+ client = DropboxApi::Client.new(access_token: access_token)
87
92
 
88
- #### Standard OAuth 2 flow
93
+ # For backwards compatibility, the following also works:
94
+ client = DropboxApi::Client.new(access_token.token)
95
+ ```
89
96
 
90
- This is what many web applications will use. The process is described in
91
- Dropbox's [OAuth guide]
92
- (https://www.dropbox.com/developers/reference/oauth-guide#oauth-2-on-the-web).
97
+ ##### Integration with Rails
93
98
 
94
99
  If you have a Rails application, you might be interested in this [setup
95
100
  guide](http://jesus.github.io/dropbox_api/file.rails_setup.html).
96
101
 
102
+
103
+ ##### Using refresh tokens
104
+
105
+ Access tokens are short-lived by default (as of September 30th, 2021),
106
+ applications that require long-lived access to the API without additional
107
+ interaction with the user should use refresh tokens.
108
+
109
+ The process is similar but a token refresh might seamlessly occur as you
110
+ perform API calls. When this happens you'll need to store the
111
+ new token hash if you want to continue using this session, you can use the
112
+ `on_token_refreshed` callback to do this.
113
+
114
+ ```ruby
115
+ # 1. Get an authorization URL, requesting offline access type.
116
+ authenticator = DropboxApi::Authenticator.new(CLIENT_ID, CLIENT_SECRET)
117
+ authenticator.auth_code.authorize_url(token_access_type: 'offline')
118
+
119
+ # 2. Log into Dropbox and authorize your app. You need to open the
120
+ # authorization URL in your browser.
121
+
122
+ # 3. Exchange the authorization code for a reusable access token
123
+ access_token = authenticator.auth_code.get_token(CODE) #=> #<OAuth2::AccessToken ...>`
124
+
125
+ # You can now use the access token to initialize a DropboxApi::Client, you
126
+ # should also provide a callback function to store the updated access token
127
+ # whenever it's refreshed.
128
+ client = DropboxApi::Client.new(
129
+ access_token: access_token,
130
+ on_token_refreshed: lambda { |new_token_hash|
131
+ # token_hash is a serializable Hash, something like this:
132
+ # {
133
+ # "uid"=>"440",
134
+ # "token_type"=>"bearer",
135
+ # "scope"=>"account_info.read account_info.write...",
136
+ # "account_id"=>"dbid:AABOLtA1rT6rRK4vajKZ...",
137
+ # :access_token=>"sl.A5Ez_CBsqJILhDawHlmXSoZEhLZ4nuLFVRs6AJ...",
138
+ # :refresh_token=>"iMg4Me_oKYUAAAAAAAAAAapQixCgwfXOxuubCuK_...",
139
+ # :expires_at=>1632948328
140
+ # }
141
+ SomewhereSafe.save(new_token_hash)
142
+ }
143
+ )
144
+ ```
145
+
146
+ Once you've gone through the process above, you can skip the steps that require
147
+ user interaction in subsequent initializations of `DropboxApi::Client`. For
148
+ example:
149
+
150
+ ```ruby
151
+ # 1. Initialize an authenticator
152
+ authenticator = DropboxApi::Authenticator.new(CLIENT_ID, CLIENT_SECRET)
153
+
154
+ # 2. Retrieve the token hash you previously stored somewhere safe, you can use
155
+ # it to build a new access token.
156
+ access_token = OAuth2::AccessToken.from_hash(authenticator, token_hash)
157
+
158
+ # 3. You now have an access token, so you can initialize a client like you
159
+ # would normally:
160
+ client = DropboxApi::Client.new(
161
+ access_token: access_token,
162
+ on_token_refreshed: lambda { |new_token_hash|
163
+ SomewhereSafe.save(new_token_hash)
164
+ }
165
+ )
166
+ ```
167
+
97
168
  ### Performing API calls
98
169
 
99
170
  Once you've initialized a client, for example:
@@ -139,6 +210,26 @@ Check out the
139
210
  [method documentation](http://www.xuuso.com/dropbox_api/DropboxApi/Client.html#upload_by_chunks-instance_method)
140
211
  to find out all available options.
141
212
 
213
+ ### Accessing Team Folders
214
+
215
+ In order to access your team scope you need to add the namespace_id to you request headers.
216
+ This can be done using the middlewere layer as per the below:
217
+
218
+ ```ruby
219
+ client = DropboxApi::Client.new("VofXAX8D...")
220
+ #=> #<DropboxApi::Client ...>
221
+ client.namespace_id = client.get_current_account.root_info.root_namespace_id
222
+
223
+ client.list_folder('')
224
+ #=> Now returns the team folders
225
+ ```
226
+
227
+ You could unset the namespace ID at any point afterwards with just:
228
+
229
+ ```ruby
230
+ client.namespace_id = nil
231
+ ```
232
+
142
233
  ## Dependencies
143
234
 
144
235
  This gem depends on
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  Class: DropboxApi::Authenticator
8
8
 
9
- &mdash; Documentation by YARD 0.9.19
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
14
 
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
16
 
17
- <script type="text/javascript" charset="utf-8">
17
+ <script type="text/javascript">
18
18
  pathId = "DropboxApi::Authenticator";
19
19
  relpath = '../';
20
20
  </script>
@@ -165,7 +165,7 @@
165
165
 
166
166
  </h3><div class="docstring">
167
167
  <div class="discussion">
168
- <p>Returns a new instance of Authenticator</p>
168
+ <p>Returns a new instance of Authenticator.</p>
169
169
 
170
170
 
171
171
  </div>
@@ -180,20 +180,20 @@
180
180
  <pre class="lines">
181
181
 
182
182
 
183
- 7
184
183
  8
185
184
  9
186
185
  10
187
186
  11
188
- 12</pre>
187
+ 12
188
+ 13</pre>
189
189
  </td>
190
190
  <td>
191
- <pre class="code"><span class="info file"># File 'lib/dropbox_api/authenticator.rb', line 7</span>
191
+ <pre class="code"><span class="info file"># File 'lib/dropbox_api/authenticator.rb', line 8</span>
192
192
 
193
193
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_client_id'>client_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_secret'>client_secret</span><span class='rparen'>)</span>
194
194
  <span class='ivar'>@auth_code</span> <span class='op'>=</span> <span class='const'>OAuth2</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_client_id'>client_id</span><span class='comma'>,</span> <span class='id identifier rubyid_client_secret'>client_secret</span><span class='comma'>,</span> <span class='lbrace'>{</span>
195
- <span class='symbol'>:authorize_url</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://www.dropbox.com/oauth2/authorize</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
196
- <span class='symbol'>:token_url</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://api.dropboxapi.com/oauth2/token</span><span class='tstring_end'>&#39;</span></span>
195
+ <span class='label'>authorize_url:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://www.dropbox.com/oauth2/authorize</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
196
+ <span class='label'>token_url:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://api.dropboxapi.com/oauth2/token</span><span class='tstring_end'>&#39;</span></span>
197
197
  <span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_auth_code'>auth_code</span>
198
198
  <span class='kw'>end</span></pre>
199
199
  </td>
@@ -207,9 +207,9 @@
207
207
  </div>
208
208
 
209
209
  <div id="footer">
210
- Generated on Fri May 31 17:53:32 2019 by
210
+ Generated on Sun Feb 7 11:51:55 2021 by
211
211
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
212
- 0.9.19 (ruby-2.6.2).
212
+ 0.9.26 (ruby-2.5.1).
213
213
  </div>
214
214
 
215
215
  </div>
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  Class: DropboxApi::ChunkedUploader
8
8
 
9
- &mdash; Documentation by YARD 0.9.19
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
14
 
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
16
 
17
- <script type="text/javascript" charset="utf-8">
17
+ <script type="text/javascript">
18
18
  pathId = "DropboxApi::ChunkedUploader";
19
19
  relpath = '../';
20
20
  </script>
@@ -238,7 +238,7 @@
238
238
 
239
239
  </h3><div class="docstring">
240
240
  <div class="discussion">
241
- <p>Returns a new instance of ChunkedUploader</p>
241
+ <p>Returns a new instance of ChunkedUploader.</p>
242
242
 
243
243
 
244
244
  </div>
@@ -253,17 +253,17 @@
253
253
  <pre class="lines">
254
254
 
255
255
 
256
- 5
257
256
  6
258
257
  7
259
258
  8
260
259
  9
261
260
  10
262
261
  11
263
- 12</pre>
262
+ 12
263
+ 13</pre>
264
264
  </td>
265
265
  <td>
266
- <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 5</span>
266
+ <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 6</span>
267
267
 
268
268
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_i_stream'>i_stream</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
269
269
  <span class='ivar'>@chunk_size</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:chunk_size</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='int'>4</span> <span class='op'>*</span> <span class='int'>1024</span> <span class='op'>*</span> <span class='int'>1024</span> <span class='comment'># 4 MiB
@@ -301,12 +301,12 @@
301
301
  <pre class="lines">
302
302
 
303
303
 
304
- 31
305
304
  32
306
- 33</pre>
305
+ 33
306
+ 34</pre>
307
307
  </td>
308
308
  <td>
309
- <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 31</span>
309
+ <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 32</span>
310
310
 
311
311
  <span class='kw'>def</span> <span class='id identifier rubyid_finish'>finish</span>
312
312
  <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_upload_session_finish'>upload_session_finish</span> <span class='ivar'>@cursor</span><span class='comma'>,</span> <span class='ivar'>@commit_info</span>
@@ -332,19 +332,19 @@
332
332
  <pre class="lines">
333
333
 
334
334
 
335
- 14
336
335
  15
337
336
  16
338
337
  17
339
338
  18
340
- 19</pre>
339
+ 19
340
+ 20</pre>
341
341
  </td>
342
342
  <td>
343
- <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 14</span>
343
+ <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 15</span>
344
344
 
345
345
  <span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span>
346
346
  <span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='ivar'>@i_stream</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span> <span class='ivar'>@chunk_size</span>
347
- <span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
347
+ <span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
348
348
 
349
349
  <span class='ivar'>@cursor</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_upload_session_start'>upload_session_start</span> <span class='id identifier rubyid_chunk'>chunk</span>
350
350
  <span class='kw'>end</span></pre>
@@ -369,7 +369,6 @@
369
369
  <pre class="lines">
370
370
 
371
371
 
372
- 21
373
372
  22
374
373
  23
375
374
  24
@@ -377,10 +376,11 @@
377
376
  26
378
377
  27
379
378
  28
380
- 29</pre>
379
+ 29
380
+ 30</pre>
381
381
  </td>
382
382
  <td>
383
- <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 21</span>
383
+ <pre class="code"><span class="info file"># File 'lib/dropbox_api/chunked_uploader.rb', line 22</span>
384
384
 
385
385
  <span class='kw'>def</span> <span class='id identifier rubyid_upload'>upload</span>
386
386
  <span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
@@ -401,9 +401,9 @@
401
401
  </div>
402
402
 
403
403
  <div id="footer">
404
- Generated on Fri May 31 17:53:32 2019 by
404
+ Generated on Sun Feb 7 11:51:55 2021 by
405
405
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
406
- 0.9.19 (ruby-2.6.2).
406
+ 0.9.26 (ruby-2.5.1).
407
407
  </div>
408
408
 
409
409
  </div>