dropbox_api 0.1.16 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (487) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +15 -0
  4. data/.travis.yml +0 -2
  5. data/Gemfile +6 -1
  6. data/README.md +7 -2
  7. data/Rakefile +4 -3
  8. data/TODO.md +16 -7
  9. data/api_coverage.md +8 -8
  10. data/bin/console +4 -3
  11. data/docs/DropboxApi/Authenticator.html +3 -3
  12. data/docs/DropboxApi/ChunkedUploader.html +3 -3
  13. data/docs/DropboxApi/Client.html +1541 -182
  14. data/docs/DropboxApi/ConnectionBuilder.html +3 -3
  15. data/docs/DropboxApi/Endpoints/Auth/TokenRevoke.html +3 -3
  16. data/docs/DropboxApi/Endpoints/Auth.html +3 -3
  17. data/docs/DropboxApi/Endpoints/Base.html +3 -3
  18. data/docs/DropboxApi/Endpoints/ContentDownload.html +3 -3
  19. data/docs/DropboxApi/Endpoints/ContentUpload.html +3 -3
  20. data/docs/DropboxApi/Endpoints/Files/Copy.html +3 -3
  21. data/docs/DropboxApi/Endpoints/Files/CopyBatch.html +359 -0
  22. data/docs/DropboxApi/Endpoints/Files/CopyBatchCheck.html +305 -0
  23. data/docs/DropboxApi/Endpoints/Files/CopyReferenceGet.html +3 -3
  24. data/docs/DropboxApi/Endpoints/Files/CopyReferenceSave.html +3 -3
  25. data/docs/DropboxApi/Endpoints/Files/CreateFileRequest.html +5 -5
  26. data/docs/DropboxApi/Endpoints/Files/CreateFolder.html +3 -3
  27. data/docs/DropboxApi/Endpoints/Files/CreateFolderBatch.html +377 -0
  28. data/docs/DropboxApi/Endpoints/Files/CreateFolderBatchCheck.html +308 -0
  29. data/docs/DropboxApi/Endpoints/Files/Delete.html +3 -3
  30. data/docs/DropboxApi/Endpoints/Files/DeleteBatch.html +305 -0
  31. data/docs/DropboxApi/Endpoints/Files/DeleteBatchCheck.html +307 -0
  32. data/docs/DropboxApi/Endpoints/Files/Download.html +3 -3
  33. data/docs/DropboxApi/Endpoints/Files/GetMetadata.html +3 -3
  34. data/docs/DropboxApi/Endpoints/Files/GetPreview.html +3 -3
  35. data/docs/DropboxApi/Endpoints/Files/GetTemporaryLink.html +3 -3
  36. data/docs/DropboxApi/Endpoints/Files/GetThumbnail.html +3 -3
  37. data/docs/DropboxApi/Endpoints/Files/GetThumbnailBatch.html +3 -3
  38. data/docs/DropboxApi/Endpoints/Files/ListFolder.html +30 -11
  39. data/docs/DropboxApi/Endpoints/Files/ListFolderContinue.html +3 -3
  40. data/docs/DropboxApi/Endpoints/Files/ListFolderGetLatestCursor.html +3 -3
  41. data/docs/DropboxApi/Endpoints/Files/ListFolderLongpoll.html +3 -3
  42. data/docs/DropboxApi/Endpoints/Files/ListRevisions.html +3 -3
  43. data/docs/DropboxApi/Endpoints/Files/Move.html +3 -3
  44. data/docs/DropboxApi/Endpoints/Files/PermanentlyDelete.html +3 -3
  45. data/docs/DropboxApi/Endpoints/Files/Restore.html +3 -3
  46. data/docs/DropboxApi/Endpoints/Files/SaveUrl.html +3 -3
  47. data/docs/DropboxApi/Endpoints/Files/SaveUrlCheckJobStatus.html +3 -3
  48. data/docs/DropboxApi/Endpoints/Files/Search.html +3 -3
  49. data/docs/DropboxApi/Endpoints/Files/Upload.html +4 -4
  50. data/docs/DropboxApi/Endpoints/Files/UploadSessionAppendV2.html +3 -3
  51. data/docs/DropboxApi/Endpoints/Files/UploadSessionFinish.html +3 -3
  52. data/docs/DropboxApi/Endpoints/Files/UploadSessionStart.html +3 -3
  53. data/docs/DropboxApi/Endpoints/Files.html +5 -5
  54. data/docs/DropboxApi/Endpoints/Rpc.html +4 -4
  55. data/docs/DropboxApi/Endpoints/RpcContent.html +3 -3
  56. data/docs/DropboxApi/Endpoints/RpcNotify.html +3 -3
  57. data/docs/DropboxApi/Endpoints/Sharing/AddFileMember.html +3 -3
  58. data/docs/DropboxApi/Endpoints/Sharing/AddFolderMember.html +3 -3
  59. data/docs/DropboxApi/Endpoints/Sharing/CreateSharedLinkWithSettings.html +103 -12
  60. data/docs/DropboxApi/Endpoints/Sharing/GetSharedLinkMetadata.html +3 -3
  61. data/docs/DropboxApi/Endpoints/Sharing/ListFileMembers.html +3 -3
  62. data/docs/DropboxApi/Endpoints/Sharing/ListFolderMembers.html +3 -3
  63. data/docs/DropboxApi/Endpoints/Sharing/ListSharedLinks.html +3 -3
  64. data/docs/DropboxApi/Endpoints/Sharing/RevokeSharedLink.html +293 -0
  65. data/docs/DropboxApi/Endpoints/Sharing/ShareFolder.html +3 -3
  66. data/docs/DropboxApi/Endpoints/Sharing/UnshareFile.html +3 -3
  67. data/docs/DropboxApi/Endpoints/Sharing.html +5 -5
  68. data/docs/DropboxApi/Endpoints/Users/GetAccount.html +3 -3
  69. data/docs/DropboxApi/Endpoints/Users/GetAccountBatch.html +3 -3
  70. data/docs/DropboxApi/Endpoints/Users/GetCurrentAccount.html +3 -3
  71. data/docs/DropboxApi/Endpoints/Users/GetSpaceUsage.html +3 -3
  72. data/docs/DropboxApi/Endpoints/Users.html +3 -3
  73. data/docs/DropboxApi/Endpoints.html +3 -3
  74. data/docs/DropboxApi/Errors/AddFileMemberError.html +3 -3
  75. data/docs/DropboxApi/Errors/AddFolderMemberError.html +3 -3
  76. data/docs/DropboxApi/Errors/AddMemberSelectorError.html +3 -3
  77. data/docs/DropboxApi/Errors/AlreadySharedError.html +3 -3
  78. data/docs/DropboxApi/Errors/BadPathError.html +3 -3
  79. data/docs/DropboxApi/Errors/BasicError.html +4 -4
  80. data/docs/DropboxApi/Errors/CantCopySharedFolderError.html +3 -3
  81. data/docs/DropboxApi/Errors/CantMoveFolderIntoItselfError.html +3 -3
  82. data/docs/DropboxApi/Errors/CantNestSharedFolderError.html +3 -3
  83. data/docs/DropboxApi/Errors/CantShareOutsideTeamError.html +3 -3
  84. data/docs/DropboxApi/Errors/ContainsSharedFolderError.html +3 -3
  85. data/docs/DropboxApi/Errors/ConversionError.html +3 -3
  86. data/docs/DropboxApi/Errors/CreateFileRequestError.html +3 -3
  87. data/docs/DropboxApi/Errors/CreateFolderBatchError.html +161 -0
  88. data/docs/DropboxApi/Errors/CreateFolderError.html +3 -3
  89. data/docs/DropboxApi/Errors/CreateSharedLinkWithSettingsError.html +3 -3
  90. data/docs/DropboxApi/Errors/CursorClosedError.html +3 -3
  91. data/docs/DropboxApi/Errors/CursorNotClosedError.html +3 -3
  92. data/docs/DropboxApi/Errors/DeleteError.html +5 -4
  93. data/docs/DropboxApi/Errors/DisallowedNameError.html +3 -3
  94. data/docs/DropboxApi/Errors/DisallowedSharedLinkPolicyError.html +3 -3
  95. data/docs/DropboxApi/Errors/DownloadError.html +3 -3
  96. data/docs/DropboxApi/Errors/DownloadFailedError.html +3 -3
  97. data/docs/DropboxApi/Errors/EmailUnverifiedError.html +3 -3
  98. data/docs/DropboxApi/Errors/FileAncestorConflictError.html +3 -3
  99. data/docs/DropboxApi/Errors/FileConflictError.html +3 -3
  100. data/docs/DropboxApi/Errors/FileMemberActionError.html +3 -3
  101. data/docs/DropboxApi/Errors/FolderConflictError.html +3 -3
  102. data/docs/DropboxApi/Errors/GetAccountError.html +3 -3
  103. data/docs/DropboxApi/Errors/GetCopyReferenceError.html +3 -3
  104. data/docs/DropboxApi/Errors/GetMetadataError.html +3 -3
  105. data/docs/DropboxApi/Errors/GroupDeletedError.html +3 -3
  106. data/docs/DropboxApi/Errors/GroupNotOnTeamError.html +3 -3
  107. data/docs/DropboxApi/Errors/HttpError.html +3 -3
  108. data/docs/DropboxApi/Errors/InProgressError.html +3 -3
  109. data/docs/DropboxApi/Errors/InsideAppFolderError.html +3 -3
  110. data/docs/DropboxApi/Errors/InsideOsxPackageError.html +3 -3
  111. data/docs/DropboxApi/Errors/InsidePublicFolderError.html +3 -3
  112. data/docs/DropboxApi/Errors/InsideSharedFolderError.html +3 -3
  113. data/docs/DropboxApi/Errors/InsufficientPlanError.html +3 -3
  114. data/docs/DropboxApi/Errors/InsufficientSpaceError.html +3 -3
  115. data/docs/DropboxApi/Errors/InternalError.html +3 -3
  116. data/docs/DropboxApi/Errors/InvalidCommentError.html +3 -3
  117. data/docs/DropboxApi/Errors/InvalidCopyReferenceError.html +3 -3
  118. data/docs/DropboxApi/Errors/InvalidCursorError.html +3 -3
  119. data/docs/DropboxApi/Errors/InvalidDropboxIdError.html +3 -3
  120. data/docs/DropboxApi/Errors/InvalidEmailError.html +3 -3
  121. data/docs/DropboxApi/Errors/InvalidFileError.html +3 -3
  122. data/docs/DropboxApi/Errors/InvalidIdError.html +3 -3
  123. data/docs/DropboxApi/Errors/InvalidMemberError.html +3 -3
  124. data/docs/DropboxApi/Errors/InvalidPathError.html +3 -3
  125. data/docs/DropboxApi/Errors/InvalidRevisionError.html +3 -3
  126. data/docs/DropboxApi/Errors/InvalidSettingsError.html +3 -3
  127. data/docs/DropboxApi/Errors/InvalidUrlError.html +3 -3
  128. data/docs/DropboxApi/Errors/IsAppFolderError.html +3 -3
  129. data/docs/DropboxApi/Errors/IsFileError.html +3 -3
  130. data/docs/DropboxApi/Errors/IsFolderError.html +3 -3
  131. data/docs/DropboxApi/Errors/IsOsxPackageError.html +3 -3
  132. data/docs/DropboxApi/Errors/IsPublicFolderError.html +3 -3
  133. data/docs/DropboxApi/Errors/ListFolderContinueError.html +3 -3
  134. data/docs/DropboxApi/Errors/ListFolderError.html +3 -3
  135. data/docs/DropboxApi/Errors/ListFolderLongpollError.html +3 -3
  136. data/docs/DropboxApi/Errors/ListRevisionsError.html +3 -3
  137. data/docs/DropboxApi/Errors/ListSharedLinksError.html +3 -3
  138. data/docs/DropboxApi/Errors/LookupError.html +3 -3
  139. data/docs/DropboxApi/Errors/MalformedPathError.html +3 -3
  140. data/docs/DropboxApi/Errors/NoAccountError.html +3 -3
  141. data/docs/DropboxApi/Errors/NoPermissionError.html +3 -3
  142. data/docs/DropboxApi/Errors/NoWritePermissionError.html +3 -3
  143. data/docs/DropboxApi/Errors/NotAMemberError.html +3 -3
  144. data/docs/DropboxApi/Errors/NotFileError.html +3 -3
  145. data/docs/DropboxApi/Errors/NotFolderError.html +3 -3
  146. data/docs/DropboxApi/Errors/NotFoundError.html +3 -3
  147. data/docs/DropboxApi/Errors/PollError.html +3 -3
  148. data/docs/DropboxApi/Errors/PreviewError.html +3 -3
  149. data/docs/DropboxApi/Errors/RateLimitError.html +3 -3
  150. data/docs/DropboxApi/Errors/RelocationBatchEntryError.html +163 -0
  151. data/docs/DropboxApi/Errors/RelocationError.html +3 -3
  152. data/docs/DropboxApi/Errors/RestoreError.html +3 -3
  153. data/docs/DropboxApi/Errors/RestrictedContentError.html +3 -3
  154. data/docs/DropboxApi/Errors/RevokeSharedLinkError.html +164 -0
  155. data/docs/DropboxApi/Errors/SaveCopyReferenceError.html +3 -3
  156. data/docs/DropboxApi/Errors/SaveUrlError.html +3 -3
  157. data/docs/DropboxApi/Errors/SearchError.html +3 -3
  158. data/docs/DropboxApi/Errors/SettingsError.html +3 -3
  159. data/docs/DropboxApi/Errors/ShareFolderError.html +3 -3
  160. data/docs/DropboxApi/Errors/SharePathError.html +3 -3
  161. data/docs/DropboxApi/Errors/SharedFolderAccessError.html +3 -3
  162. data/docs/DropboxApi/Errors/SharedLinkAccessDeniedError.html +3 -3
  163. data/docs/DropboxApi/Errors/SharedLinkAlreadyExistsError.html +3 -3
  164. data/docs/DropboxApi/Errors/SharedLinkError.html +3 -3
  165. data/docs/DropboxApi/Errors/SharedLinkMalformedError.html +143 -0
  166. data/docs/DropboxApi/Errors/SharedLinkNotFoundError.html +3 -3
  167. data/docs/DropboxApi/Errors/SharingFileAccessError.html +3 -3
  168. data/docs/DropboxApi/Errors/SharingUserError.html +3 -3
  169. data/docs/DropboxApi/Errors/TeamFolderError.html +3 -3
  170. data/docs/DropboxApi/Errors/TeamPolicyDisallowsMemberPolicyError.html +3 -3
  171. data/docs/DropboxApi/Errors/ThumbnailBatchError.html +3 -3
  172. data/docs/DropboxApi/Errors/ThumbnailError.html +3 -3
  173. data/docs/DropboxApi/Errors/TooManyFilesError.html +3 -3
  174. data/docs/DropboxApi/Errors/TooManyMembersError.html +3 -3
  175. data/docs/DropboxApi/Errors/TooManyPendingInvitesError.html +3 -3
  176. data/docs/DropboxApi/Errors/TooManyRequestsError.html +3 -3
  177. data/docs/DropboxApi/Errors/TooManySharedFolderTargetsError.html +3 -3
  178. data/docs/DropboxApi/Errors/TooManyWriteOperationsError.html +3 -3
  179. data/docs/DropboxApi/Errors/UnmountedError.html +3 -3
  180. data/docs/DropboxApi/Errors/UnshareFileError.html +3 -3
  181. data/docs/DropboxApi/Errors/UnsupportedContentError.html +3 -3
  182. data/docs/DropboxApi/Errors/UnsupportedExtensionError.html +3 -3
  183. data/docs/DropboxApi/Errors/UnsupportedImageError.html +3 -3
  184. data/docs/DropboxApi/Errors/UnsupportedLinkTypeError.html +3 -3
  185. data/docs/DropboxApi/Errors/UnverifiedDropboxId.html +3 -3
  186. data/docs/DropboxApi/Errors/UploadError.html +3 -3
  187. data/docs/DropboxApi/Errors/UploadSessionFinishError.html +3 -3
  188. data/docs/DropboxApi/Errors/UploadSessionLookupError.html +3 -3
  189. data/docs/DropboxApi/Errors/UploadSessionOffsetError.html +3 -3
  190. data/docs/DropboxApi/Errors/UploadWriteFailedError.html +3 -3
  191. data/docs/DropboxApi/Errors/WriteConflictError.html +3 -3
  192. data/docs/DropboxApi/Errors/WriteError.html +3 -3
  193. data/docs/DropboxApi/Errors.html +5 -5
  194. data/docs/DropboxApi/Metadata/AccessLevel.html +3 -3
  195. data/docs/DropboxApi/Metadata/AddFileMemberResult.html +3 -3
  196. data/docs/DropboxApi/Metadata/AddMember.html +3 -3
  197. data/docs/DropboxApi/Metadata/Base.html +3 -3
  198. data/docs/DropboxApi/Metadata/BasicAccount.html +3 -3
  199. data/docs/DropboxApi/Metadata/CommitInfo.html +3 -3
  200. data/docs/DropboxApi/Metadata/Deleted.html +3 -3
  201. data/docs/DropboxApi/Metadata/Dimensions.html +3 -3
  202. data/docs/DropboxApi/Metadata/Field.html +3 -3
  203. data/docs/DropboxApi/Metadata/File.html +3 -3
  204. data/docs/DropboxApi/Metadata/FileLinkMetadata.html +3 -3
  205. data/docs/DropboxApi/Metadata/FileMemberAction.html +3 -3
  206. data/docs/DropboxApi/Metadata/FileRequest.html +3 -3
  207. data/docs/DropboxApi/Metadata/Folder.html +3 -3
  208. data/docs/DropboxApi/Metadata/FolderLinkMetadata.html +3 -3
  209. data/docs/DropboxApi/Metadata/FolderSharingInfo.html +3 -3
  210. data/docs/DropboxApi/Metadata/LinkPermissions.html +3 -3
  211. data/docs/DropboxApi/Metadata/Location.html +3 -3
  212. data/docs/DropboxApi/Metadata/MediaInfo.html +3 -3
  213. data/docs/DropboxApi/Metadata/MediaMetadata.html +3 -3
  214. data/docs/DropboxApi/Metadata/Member.html +3 -3
  215. data/docs/DropboxApi/Metadata/MemberAction.html +3 -3
  216. data/docs/DropboxApi/Metadata/MemberActionList.html +3 -3
  217. data/docs/DropboxApi/Metadata/MemberPermission.html +3 -3
  218. data/docs/DropboxApi/Metadata/MemberPermissionList.html +3 -3
  219. data/docs/DropboxApi/Metadata/Name.html +3 -3
  220. data/docs/DropboxApi/Metadata/ParentFolderAccessInfo.html +3 -3
  221. data/docs/DropboxApi/Metadata/PhotoMetadata.html +3 -3
  222. data/docs/DropboxApi/Metadata/Resource.html +3 -3
  223. data/docs/DropboxApi/Metadata/SharedFolder.html +3 -3
  224. data/docs/DropboxApi/Metadata/SharedFolderPolicy.html +3 -3
  225. data/docs/DropboxApi/Metadata/SharedLink.html +3 -3
  226. data/docs/DropboxApi/Metadata/SharedLinkMetadata.html +3 -3
  227. data/docs/DropboxApi/Metadata/SpaceAllocation.html +3 -3
  228. data/docs/DropboxApi/Metadata/SpaceUsage.html +3 -3
  229. data/docs/DropboxApi/Metadata/Tag.html +3 -3
  230. data/docs/DropboxApi/Metadata/Team.html +3 -3
  231. data/docs/DropboxApi/Metadata/TeamMemberInfo.html +3 -3
  232. data/docs/DropboxApi/Metadata/ThumbnailBatchResultData.html +3 -3
  233. data/docs/DropboxApi/Metadata/ThumbnailBatchResultEntry.html +3 -3
  234. data/docs/DropboxApi/Metadata/UploadSessionCursor.html +3 -3
  235. data/docs/DropboxApi/Metadata/VideoMetadata.html +3 -3
  236. data/docs/DropboxApi/Metadata/WriteMode.html +3 -3
  237. data/docs/DropboxApi/Metadata.html +3 -3
  238. data/docs/DropboxApi/MiddleWare/DecodeResult.html +3 -3
  239. data/docs/DropboxApi/MiddleWare/Stack.html +3 -3
  240. data/docs/DropboxApi/MiddleWare.html +3 -3
  241. data/docs/DropboxApi/OptionsValidator.html +4 -4
  242. data/docs/DropboxApi/ResultBuilder.html +3 -3
  243. data/docs/DropboxApi/Results/AddFileMemberResultList.html +3 -3
  244. data/docs/DropboxApi/Results/Base.html +4 -4
  245. data/docs/DropboxApi/Results/BasicAccountBatch.html +3 -3
  246. data/docs/DropboxApi/Results/CopyBatchResult.html +224 -0
  247. data/docs/DropboxApi/Results/CreateFolderBatchResult.html +241 -0
  248. data/docs/DropboxApi/Results/CreateFolderBatchResultEntry.html +234 -0
  249. data/docs/DropboxApi/Results/DeleteBatchResult.html +241 -0
  250. data/docs/DropboxApi/Results/DeleteBatchResultEntry.html +226 -0
  251. data/docs/DropboxApi/Results/GetCopyReferenceResult.html +3 -3
  252. data/docs/DropboxApi/Results/GetTemporaryLinkResult.html +3 -3
  253. data/docs/DropboxApi/Results/GetThumbnailBatchResult.html +3 -3
  254. data/docs/DropboxApi/Results/ListFolderGetLatestCursorResult.html +3 -3
  255. data/docs/DropboxApi/Results/ListFolderLongpollResult.html +3 -3
  256. data/docs/DropboxApi/Results/ListFolderResult.html +3 -3
  257. data/docs/DropboxApi/Results/ListRevisionsResult.html +3 -3
  258. data/docs/DropboxApi/Results/ListSharedLinksResult.html +3 -3
  259. data/docs/DropboxApi/Results/RelocationBatchResult.html +241 -0
  260. data/docs/DropboxApi/Results/RelocationBatchResultEntry.html +226 -0
  261. data/docs/DropboxApi/Results/SaveCopyReferenceResult.html +3 -3
  262. data/docs/DropboxApi/Results/SaveUrlJobStatus.html +3 -3
  263. data/docs/DropboxApi/Results/SaveUrlResult.html +3 -3
  264. data/docs/DropboxApi/Results/Search/Match.html +3 -3
  265. data/docs/DropboxApi/Results/Search.html +3 -3
  266. data/docs/DropboxApi/Results/SearchResult.html +3 -3
  267. data/docs/DropboxApi/Results/ShareFolderLaunch.html +3 -3
  268. data/docs/DropboxApi/Results/SharedFileMembers.html +3 -3
  269. data/docs/DropboxApi/Results/SharedFolderMembers.html +3 -3
  270. data/docs/DropboxApi/Results/UploadSessionStart.html +3 -3
  271. data/docs/DropboxApi/Results/VoidResult.html +3 -3
  272. data/docs/DropboxApi/Results.html +5 -5
  273. data/docs/DropboxApi.html +4 -4
  274. data/docs/DropboxScaffoldBuilder.html +105 -50
  275. data/docs/_index.html +140 -14
  276. data/docs/class_list.html +1 -1
  277. data/docs/file.README.html +3 -3
  278. data/docs/file.api_coverage.html +10 -10
  279. data/docs/file.rails_setup.html +3 -3
  280. data/docs/frames.html +1 -1
  281. data/docs/index.html +3 -3
  282. data/docs/js/app.js +11 -0
  283. data/docs/method_list.html +430 -254
  284. data/docs/top-level-namespace.html +3 -3
  285. data/dropbox_api.gemspec +15 -16
  286. data/lib/dropbox_api/authenticator.rb +3 -2
  287. data/lib/dropbox_api/chunked_uploader.rb +2 -1
  288. data/lib/dropbox_api/client.rb +2 -1
  289. data/lib/dropbox_api/connection_builder.rb +1 -0
  290. data/lib/dropbox_api/endpoints/auth/token_revoke.rb +2 -1
  291. data/lib/dropbox_api/endpoints/base.rb +7 -4
  292. data/lib/dropbox_api/endpoints/content_download.rb +4 -6
  293. data/lib/dropbox_api/endpoints/content_upload.rb +2 -1
  294. data/lib/dropbox_api/endpoints/file_requests/create_file_request.rb +2 -1
  295. data/lib/dropbox_api/endpoints/files/copy.rb +4 -3
  296. data/lib/dropbox_api/endpoints/files/copy_batch.rb +36 -0
  297. data/lib/dropbox_api/endpoints/files/copy_batch_check.rb +21 -0
  298. data/lib/dropbox_api/endpoints/files/copy_reference_get.rb +3 -2
  299. data/lib/dropbox_api/endpoints/files/copy_reference_save.rb +4 -3
  300. data/lib/dropbox_api/endpoints/files/create_folder.rb +3 -2
  301. data/lib/dropbox_api/endpoints/files/create_folder_batch.rb +41 -0
  302. data/lib/dropbox_api/endpoints/files/create_folder_batch_check.rb +22 -0
  303. data/lib/dropbox_api/endpoints/files/delete.rb +3 -2
  304. data/lib/dropbox_api/endpoints/files/delete_batch.rb +23 -0
  305. data/lib/dropbox_api/endpoints/files/delete_batch_check.rb +21 -0
  306. data/lib/dropbox_api/endpoints/files/download.rb +3 -2
  307. data/lib/dropbox_api/endpoints/files/get_metadata.rb +3 -2
  308. data/lib/dropbox_api/endpoints/files/get_preview.rb +3 -2
  309. data/lib/dropbox_api/endpoints/files/get_temporary_link.rb +3 -2
  310. data/lib/dropbox_api/endpoints/files/get_thumbnail.rb +3 -2
  311. data/lib/dropbox_api/endpoints/files/get_thumbnail_batch.rb +4 -3
  312. data/lib/dropbox_api/endpoints/files/list_folder.rb +3 -2
  313. data/lib/dropbox_api/endpoints/files/list_folder_continue.rb +3 -2
  314. data/lib/dropbox_api/endpoints/files/list_folder_get_latest_cursor.rb +2 -1
  315. data/lib/dropbox_api/endpoints/files/list_folder_longpoll.rb +3 -2
  316. data/lib/dropbox_api/endpoints/files/list_revisions.rb +3 -2
  317. data/lib/dropbox_api/endpoints/files/move.rb +4 -3
  318. data/lib/dropbox_api/endpoints/files/permanently_delete.rb +3 -2
  319. data/lib/dropbox_api/endpoints/files/restore.rb +4 -3
  320. data/lib/dropbox_api/endpoints/files/save_url.rb +4 -3
  321. data/lib/dropbox_api/endpoints/files/save_url_check_job_status.rb +3 -2
  322. data/lib/dropbox_api/endpoints/files/search.rb +16 -27
  323. data/lib/dropbox_api/endpoints/files/upload.rb +3 -2
  324. data/lib/dropbox_api/endpoints/files/upload_session_append_v2.rb +3 -2
  325. data/lib/dropbox_api/endpoints/files/upload_session_finish.rb +4 -3
  326. data/lib/dropbox_api/endpoints/files/upload_session_start.rb +4 -3
  327. data/lib/dropbox_api/endpoints/rpc.rb +2 -1
  328. data/lib/dropbox_api/endpoints/rpc_content.rb +2 -1
  329. data/lib/dropbox_api/endpoints/rpc_notify.rb +2 -1
  330. data/lib/dropbox_api/endpoints/sharing/add_file_member.rb +4 -3
  331. data/lib/dropbox_api/endpoints/sharing/add_folder_member.rb +4 -3
  332. data/lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb +4 -3
  333. data/lib/dropbox_api/endpoints/sharing/get_shared_link_metadata.rb +3 -2
  334. data/lib/dropbox_api/endpoints/sharing/list_file_members.rb +4 -3
  335. data/lib/dropbox_api/endpoints/sharing/list_folder_members.rb +4 -3
  336. data/lib/dropbox_api/endpoints/sharing/list_shared_links.rb +2 -1
  337. data/lib/dropbox_api/endpoints/sharing/revoke_shared_link.rb +3 -2
  338. data/lib/dropbox_api/endpoints/sharing/share_folder.rb +3 -2
  339. data/lib/dropbox_api/endpoints/sharing/unshare_file.rb +3 -2
  340. data/lib/dropbox_api/endpoints/users/get_account.rb +3 -2
  341. data/lib/dropbox_api/endpoints/users/get_account_batch.rb +3 -2
  342. data/lib/dropbox_api/endpoints/users/get_current_account.rb +2 -1
  343. data/lib/dropbox_api/endpoints/users/get_space_usage.rb +2 -1
  344. data/lib/dropbox_api/endpoints/virtual/upload_by_chunks.rb +1 -0
  345. data/lib/dropbox_api/errors/add_file_member_error.rb +5 -4
  346. data/lib/dropbox_api/errors/add_folder_member_error.rb +11 -10
  347. data/lib/dropbox_api/errors/add_member_selector_error.rb +6 -5
  348. data/lib/dropbox_api/errors/already_shared_error.rb +1 -0
  349. data/lib/dropbox_api/errors/basic_error.rb +2 -1
  350. data/lib/dropbox_api/errors/create_file_request_error.rb +1 -0
  351. data/lib/dropbox_api/errors/create_folder_batch_error.rb +8 -0
  352. data/lib/dropbox_api/errors/create_folder_error.rb +2 -1
  353. data/lib/dropbox_api/errors/create_shared_link_with_settings_error.rb +6 -5
  354. data/lib/dropbox_api/errors/delete_error.rb +5 -3
  355. data/lib/dropbox_api/errors/download_error.rb +2 -1
  356. data/lib/dropbox_api/errors/file_member_action_error.rb +5 -4
  357. data/lib/dropbox_api/errors/get_account_error.rb +2 -1
  358. data/lib/dropbox_api/errors/get_copy_reference_error.rb +2 -1
  359. data/lib/dropbox_api/errors/get_metadata_error.rb +2 -1
  360. data/lib/dropbox_api/errors/http_error.rb +1 -0
  361. data/lib/dropbox_api/errors/list_folder_continue_error.rb +3 -2
  362. data/lib/dropbox_api/errors/list_folder_error.rb +2 -1
  363. data/lib/dropbox_api/errors/list_folder_longpoll_error.rb +2 -1
  364. data/lib/dropbox_api/errors/list_revisions_error.rb +2 -1
  365. data/lib/dropbox_api/errors/list_shared_links_error.rb +3 -2
  366. data/lib/dropbox_api/errors/lookup_error.rb +6 -5
  367. data/lib/dropbox_api/errors/poll_error.rb +3 -2
  368. data/lib/dropbox_api/errors/preview_error.rb +5 -4
  369. data/lib/dropbox_api/errors/relocation_batch_entry_error.rb +10 -0
  370. data/lib/dropbox_api/errors/relocation_error.rb +8 -7
  371. data/lib/dropbox_api/errors/restore_error.rb +4 -3
  372. data/lib/dropbox_api/errors/revoke_shared_link_error.rb +5 -4
  373. data/lib/dropbox_api/errors/save_copy_reference_error.rb +6 -5
  374. data/lib/dropbox_api/errors/save_url_error.rb +5 -4
  375. data/lib/dropbox_api/errors/search_error.rb +2 -1
  376. data/lib/dropbox_api/errors/settings_error.rb +3 -2
  377. data/lib/dropbox_api/errors/share_folder_error.rb +6 -5
  378. data/lib/dropbox_api/errors/share_path_error.rb +12 -11
  379. data/lib/dropbox_api/errors/shared_folder_access_error.rb +5 -4
  380. data/lib/dropbox_api/errors/shared_link_error.rb +4 -3
  381. data/lib/dropbox_api/errors/sharing_file_access_error.rb +6 -5
  382. data/lib/dropbox_api/errors/sharing_user_error.rb +2 -1
  383. data/lib/dropbox_api/errors/thumbnail_batch_error.rb +2 -1
  384. data/lib/dropbox_api/errors/thumbnail_error.rb +5 -4
  385. data/lib/dropbox_api/errors/too_many_requests_error.rb +3 -2
  386. data/lib/dropbox_api/errors/unshare_file_error.rb +3 -2
  387. data/lib/dropbox_api/errors/upload_error.rb +2 -1
  388. data/lib/dropbox_api/errors/upload_session_finish_error.rb +4 -3
  389. data/lib/dropbox_api/errors/upload_session_lookup_error.rb +5 -4
  390. data/lib/dropbox_api/errors/upload_session_offset_error.rb +1 -0
  391. data/lib/dropbox_api/errors/upload_write_failed_error.rb +2 -1
  392. data/lib/dropbox_api/errors/write_conflict_error.rb +4 -3
  393. data/lib/dropbox_api/errors/write_error.rb +6 -5
  394. data/lib/dropbox_api/metadata/access_level.rb +1 -0
  395. data/lib/dropbox_api/metadata/add_file_member_result.rb +1 -0
  396. data/lib/dropbox_api/metadata/add_member.rb +3 -2
  397. data/lib/dropbox_api/metadata/base.rb +2 -1
  398. data/lib/dropbox_api/metadata/basic_account.rb +1 -0
  399. data/lib/dropbox_api/metadata/commit_info.rb +2 -1
  400. data/lib/dropbox_api/metadata/deleted.rb +1 -0
  401. data/lib/dropbox_api/metadata/dimensions.rb +1 -0
  402. data/lib/dropbox_api/metadata/field.rb +7 -4
  403. data/lib/dropbox_api/metadata/file.rb +2 -1
  404. data/lib/dropbox_api/metadata/file_categories_list.rb +9 -0
  405. data/lib/dropbox_api/metadata/file_category.rb +22 -0
  406. data/lib/dropbox_api/metadata/file_extensions_list.rb +13 -0
  407. data/lib/dropbox_api/metadata/file_link_metadata.rb +1 -0
  408. data/lib/dropbox_api/metadata/file_member_action.rb +2 -1
  409. data/lib/dropbox_api/metadata/file_request.rb +1 -0
  410. data/lib/dropbox_api/metadata/file_status.rb +14 -0
  411. data/lib/dropbox_api/metadata/folder.rb +2 -1
  412. data/lib/dropbox_api/metadata/folder_link_metadata.rb +1 -0
  413. data/lib/dropbox_api/metadata/folder_sharing_info.rb +1 -0
  414. data/lib/dropbox_api/metadata/link_permissions.rb +1 -0
  415. data/lib/dropbox_api/metadata/location.rb +1 -0
  416. data/lib/dropbox_api/metadata/media_info.rb +1 -0
  417. data/lib/dropbox_api/metadata/media_metadata.rb +1 -0
  418. data/lib/dropbox_api/metadata/member.rb +6 -5
  419. data/lib/dropbox_api/metadata/member_action.rb +1 -0
  420. data/lib/dropbox_api/metadata/member_action_list.rb +1 -0
  421. data/lib/dropbox_api/metadata/member_permission.rb +1 -0
  422. data/lib/dropbox_api/metadata/member_permission_list.rb +1 -0
  423. data/lib/dropbox_api/metadata/metadata_v2.rb +7 -0
  424. data/lib/dropbox_api/metadata/name.rb +1 -0
  425. data/lib/dropbox_api/metadata/parent_folder_access_info.rb +1 -0
  426. data/lib/dropbox_api/metadata/photo_metadata.rb +1 -0
  427. data/lib/dropbox_api/metadata/resource.rb +2 -1
  428. data/lib/dropbox_api/metadata/search_match_field_options.rb +9 -0
  429. data/lib/dropbox_api/metadata/search_match_type_v2.rb +16 -0
  430. data/lib/dropbox_api/metadata/search_match_v2.rb +18 -0
  431. data/lib/dropbox_api/metadata/search_options.rb +33 -0
  432. data/lib/dropbox_api/metadata/search_order_by.rb +14 -0
  433. data/lib/dropbox_api/metadata/shared_folder.rb +1 -0
  434. data/lib/dropbox_api/metadata/shared_folder_policy.rb +1 -0
  435. data/lib/dropbox_api/metadata/shared_link.rb +3 -2
  436. data/lib/dropbox_api/metadata/shared_link_metadata.rb +2 -1
  437. data/lib/dropbox_api/metadata/space_allocation.rb +1 -0
  438. data/lib/dropbox_api/metadata/space_usage.rb +1 -0
  439. data/lib/dropbox_api/metadata/tag.rb +2 -1
  440. data/lib/dropbox_api/metadata/team.rb +1 -0
  441. data/lib/dropbox_api/metadata/team_member_info.rb +1 -0
  442. data/lib/dropbox_api/metadata/thumbnail_batch_result_data.rb +1 -0
  443. data/lib/dropbox_api/metadata/thumbnail_batch_result_entry.rb +3 -2
  444. data/lib/dropbox_api/metadata/upload_session_cursor.rb +1 -0
  445. data/lib/dropbox_api/metadata/video_metadata.rb +1 -0
  446. data/lib/dropbox_api/metadata/write_mode.rb +6 -5
  447. data/lib/dropbox_api/middleware/decode_result.rb +3 -2
  448. data/lib/dropbox_api/middleware/stack.rb +1 -0
  449. data/lib/dropbox_api/options_validator.rb +1 -0
  450. data/lib/dropbox_api/result_builder.rb +3 -2
  451. data/lib/dropbox_api/results/add_file_member_result_list.rb +1 -0
  452. data/lib/dropbox_api/results/base.rb +1 -0
  453. data/lib/dropbox_api/results/basic_account_batch.rb +1 -0
  454. data/lib/dropbox_api/results/copy_batch_result.rb +15 -0
  455. data/lib/dropbox_api/results/create_folder_batch_result.rb +21 -0
  456. data/lib/dropbox_api/results/create_folder_batch_result_entry.rb +20 -0
  457. data/lib/dropbox_api/results/delete_batch_result.rb +21 -0
  458. data/lib/dropbox_api/results/delete_batch_result_entry.rb +16 -0
  459. data/lib/dropbox_api/results/get_copy_reference_result.rb +4 -3
  460. data/lib/dropbox_api/results/get_temporary_link_result.rb +3 -2
  461. data/lib/dropbox_api/results/get_thumbnail_batch_result.rb +2 -1
  462. data/lib/dropbox_api/results/list_folder_get_latest_cursor_result.rb +2 -1
  463. data/lib/dropbox_api/results/list_folder_longpoll_result.rb +3 -2
  464. data/lib/dropbox_api/results/list_folder_result.rb +4 -3
  465. data/lib/dropbox_api/results/list_revisions_result.rb +3 -2
  466. data/lib/dropbox_api/results/list_shared_links_result.rb +4 -3
  467. data/lib/dropbox_api/results/relocation_batch_result.rb +21 -0
  468. data/lib/dropbox_api/results/relocation_batch_result_entry.rb +16 -0
  469. data/lib/dropbox_api/results/save_copy_reference_result.rb +2 -1
  470. data/lib/dropbox_api/results/save_url_job_status.rb +7 -6
  471. data/lib/dropbox_api/results/save_url_result.rb +2 -1
  472. data/lib/dropbox_api/results/search/match.rb +3 -2
  473. data/lib/dropbox_api/results/search_v2_result.rb +24 -0
  474. data/lib/dropbox_api/results/share_folder_launch.rb +4 -3
  475. data/lib/dropbox_api/results/shared_file_members.rb +5 -4
  476. data/lib/dropbox_api/results/shared_folder_members.rb +5 -4
  477. data/lib/dropbox_api/results/upload_session_start.rb +2 -1
  478. data/lib/dropbox_api/results/void_result.rb +1 -0
  479. data/lib/dropbox_api/version.rb +2 -1
  480. data/lib/dropbox_api.rb +28 -3
  481. data/yardoc/endpoint_handler.rb +2 -1
  482. data/yardoc/helpers/html_helper.rb +2 -1
  483. data/yardoc/rspec.rb +3 -2
  484. data/yardoc/templates/default/method_details/setup.rb +1 -0
  485. metadata +64 -28
  486. data/CHANGES.md +0 -7
  487. data/lib/dropbox_api/results/search_result.rb +0 -22
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::MiddleWare
2
3
  class DecodeResult < Faraday::Middleware
3
4
  def call(rq_env)
@@ -14,7 +15,7 @@ module DropboxApi::MiddleWare
14
15
  # Dropbox may send a response with the string 'null' in its body, this
15
16
  # would be a void result. `add_folder_member` is an example of an
16
17
  # endpoint without return values.
17
- if json == "null"
18
+ if json == 'null'
18
19
  {}
19
20
  else
20
21
  JSON.parse json
@@ -22,5 +23,5 @@ module DropboxApi::MiddleWare
22
23
  end
23
24
  end
24
25
 
25
- Faraday::Response.register_middleware :decode_result => DecodeResult
26
+ Faraday::Response.register_middleware decode_result: DecodeResult
26
27
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::MiddleWare
2
3
  class Stack
3
4
  def initialize
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi
2
3
  module OptionsValidator
3
4
  # Takes in a list of valid option keys and a hash of options. If one of the
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi
2
3
  class ResultBuilder
3
4
  def initialize(response_data)
@@ -5,11 +6,11 @@ module DropboxApi
5
6
  end
6
7
 
7
8
  def error_summary
8
- @response_data["error_summary"] if @response_data.is_a? Hash
9
+ @response_data['error_summary'] if @response_data.is_a? Hash
9
10
  end
10
11
 
11
12
  def error
12
- @response_data["error"]
13
+ @response_data['error']
13
14
  end
14
15
 
15
16
  def has_error?
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  # Example of a result of the `add_file_member` endpoint:
3
4
  # [{
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class Base
3
4
  def initialize(result_data)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class BasicAccountBatch < Array
3
4
  def initialize(accounts)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ class CopyBatchResult < DropboxApi::Results::Base
4
+ def self.new(result_data)
5
+ case result_data['.tag']
6
+ when 'async_job_id'
7
+ result_data['async_job_id']
8
+ when 'complete'
9
+ RelocationBatchResult.new(result_data)
10
+ else
11
+ raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ # Result returned by {Client#create_folder_batch} that may either launch an
4
+ # asynchronous job or complete synchronously.
5
+ #
6
+ # The value will be either a job id or a list of job statuses.
7
+ class CreateFolderBatchResult < DropboxApi::Results::Base
8
+ def self.new(result_data)
9
+ case result_data['.tag']
10
+ when 'async_job_id'
11
+ result_data
12
+ when 'complete'
13
+ result_data['entries'].map do |entry|
14
+ DropboxApi::Results::CreateFolderBatchResultEntry.new(entry)
15
+ end
16
+ else
17
+ raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ class CreateFolderBatchResultEntry < DropboxApi::Results::Base
4
+ def self.new(result_data)
5
+ case result_data['.tag']
6
+ when 'success'
7
+ DropboxApi::Metadata::Folder.new result_data['metadata']
8
+ when 'failure'
9
+ # At the moment, this is a `CreateFolderEntryError` which is an open
10
+ # union that can only be a `WriteError`. In the future, more errors
11
+ # could be added to the API which means we'd have to implement the
12
+ # actual `CreateFolderEntryError` class.
13
+ DropboxApi::Errors::WriteError
14
+ .build('Folder operation failed', result_data['failure']['path'])
15
+ else
16
+ raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ # Result returned by {Client#delete_batch} that may either launch an
4
+ # asynchronous job or complete synchronously.
5
+ #
6
+ # The value will be either a job id or a list of job statuses.
7
+ class DeleteBatchResult < DropboxApi::Results::Base
8
+ def self.new(result_data)
9
+ case result_data['.tag']
10
+ when 'async_job_id'
11
+ result_data
12
+ when 'complete'
13
+ result_data['entries'].map do |entry|
14
+ DropboxApi::Results::DeleteBatchResultEntry.new(entry)
15
+ end
16
+ else
17
+ raise NotImplementedError, "Unknown result type: #{result_data[".tag"]}"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ class DeleteBatchResultEntry < DropboxApi::Results::Base
4
+ def self.new(result_data)
5
+ case result_data['.tag']
6
+ when 'success'
7
+ DropboxApi::Metadata::Resource.new result_data['metadata']
8
+ when 'failure'
9
+ DropboxApi::Errors::DeleteError
10
+ .build('Delete operation failed', result_data['failure'])
11
+ else
12
+ raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,20 +1,21 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class GetCopyReferenceResult < DropboxApi::Results::Base
3
4
  # Metadata of the file or folder.
4
5
  def resource
5
- @resource ||= DropboxApi::Metadata::Resource.new @data["metadata"]
6
+ @resource ||= DropboxApi::Metadata::Resource.new @data['metadata']
6
7
  end
7
8
 
8
9
  # A copy reference to the file or folder.
9
10
  def copy_reference
10
- @copy_reference ||= @data["copy_reference"]
11
+ @copy_reference ||= @data['copy_reference']
11
12
  end
12
13
 
13
14
  # The expiration date of the copy reference.
14
15
  # This value is currently set to be far enough in the future
15
16
  # so that expiration is effectively not an issue.
16
17
  def expires
17
- @expires ||= Time.parse(@data["expires"])
18
+ @expires ||= Time.parse(@data['expires'])
18
19
  end
19
20
  end
20
21
  end
@@ -1,11 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class GetTemporaryLinkResult < DropboxApi::Results::Base
3
4
  def file
4
- @file ||= DropboxApi::Metadata::File.new(@data["metadata"])
5
+ @file ||= DropboxApi::Metadata::File.new(@data['metadata'])
5
6
  end
6
7
 
7
8
  def link
8
- @data["link"]
9
+ @data['link']
9
10
  end
10
11
  end
11
12
  end
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class GetThumbnailBatchResult < DropboxApi::Results::Base
3
4
  def entries
4
- @entries ||= @data["entries"].map do |entry|
5
+ @entries ||= @data['entries'].map do |entry|
5
6
  DropboxApi::Metadata::ThumbnailBatchResultEntry.new entry
6
7
  end
7
8
  end
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class ListFolderGetLatestCursorResult < DropboxApi::Results::Base
3
4
  def cursor
4
- @data["cursor"]
5
+ @data['cursor']
5
6
  end
6
7
  end
7
8
  end
@@ -1,15 +1,16 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class ListFolderLongpollResult < DropboxApi::Results::Base
3
4
  # Indicates whether new changes are available. If true, call
4
5
  # `list_folder_continue` to retrieve the changes.
5
6
  def changes
6
- @data["changes"].to_s == "true"
7
+ @data['changes'].to_s == 'true'
7
8
  end
8
9
 
9
10
  # If present, backoff for at least this many seconds before calling
10
11
  # `list_folder_longpoll` again. This field is optional.
11
12
  def backoff
12
- @data["backoff"]
13
+ @data['backoff']
13
14
  end
14
15
  end
15
16
  end
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class ListFolderResult < DropboxApi::Results::Base
3
4
  # A collection of files and directories.
4
5
  def entries
5
- @entries ||= @data["entries"].map do |entry|
6
+ @entries ||= @data['entries'].map do |entry|
6
7
  DropboxApi::Metadata::Resource.new entry
7
8
  end
8
9
  end
@@ -10,13 +11,13 @@ module DropboxApi::Results
10
11
  # Pass the cursor into `list_folder_continue` to see what's changed in the
11
12
  # folder since your previous query.
12
13
  def cursor
13
- @data["cursor"]
14
+ @data['cursor']
14
15
  end
15
16
 
16
17
  # If true, then there are more entries available. Pass the cursor to
17
18
  # `list_folder_continue` to retrieve the rest.
18
19
  def has_more?
19
- @data["has_more"].to_s == "true"
20
+ @data['has_more'].to_s == 'true'
20
21
  end
21
22
  end
22
23
  end
@@ -1,14 +1,15 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class ListRevisionsResult < DropboxApi::Results::Base
3
4
  # A collection of files and directories.
4
5
  def entries
5
- @entries ||= @data["entries"].map do |entry|
6
+ @entries ||= @data['entries'].map do |entry|
6
7
  DropboxApi::Metadata::File.new entry
7
8
  end
8
9
  end
9
10
 
10
11
  def is_deleted?
11
- @data["is_deleted"] == true
12
+ @data['is_deleted'] == true
12
13
  end
13
14
  end
14
15
  end
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class ListSharedLinksResult < DropboxApi::Results::Base
3
4
  # Shared links applicable to the path argument.
4
5
  def links
5
- @entries ||= @data["links"].map do |entry|
6
+ @entries ||= @data['links'].map do |entry|
6
7
  DropboxApi::Metadata::SharedLinkMetadata.new entry
7
8
  end
8
9
  end
@@ -10,13 +11,13 @@ module DropboxApi::Results
10
11
  # Pass the cursor into `list_folder_continue` to see what's changed in the
11
12
  # folder since your previous query.
12
13
  def cursor
13
- @data["cursor"]
14
+ @data['cursor']
14
15
  end
15
16
 
16
17
  # If true, then there are more entries available. Pass the cursor to
17
18
  # `list_folder_continue` to retrieve the rest.
18
19
  def has_more?
19
- @data["has_more"].to_s == "true"
20
+ @data['has_more'].to_s == 'true'
20
21
  end
21
22
  end
22
23
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ # Result returned by {Client#copy_batch} or {Client#move_batch} that may
4
+ # either launch an asynchronous job or complete synchronously.
5
+ #
6
+ # The value will be either `:in_progress` or a list of job statuses.
7
+ class RelocationBatchResult < DropboxApi::Results::Base
8
+ def self.new(result_data)
9
+ case result_data['.tag']
10
+ when 'in_progress'
11
+ :in_progress
12
+ when 'complete'
13
+ result_data['entries'].map do |entry|
14
+ DropboxApi::Results::RelocationBatchResultEntry.new(entry)
15
+ end
16
+ else
17
+ raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ class RelocationBatchResultEntry < DropboxApi::Results::Base
4
+ def self.new(result_data)
5
+ case result_data['.tag']
6
+ when 'success'
7
+ DropboxApi::Metadata::Resource.new result_data['success']
8
+ when 'failure'
9
+ DropboxApi::Errors::RelocationBatchEntryError
10
+ .build('File or folder operation failed', result_data['failure'])
11
+ else
12
+ raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class SaveCopyReferenceResult < DropboxApi::Results::Base
3
4
  # The saved file or folder in the user's Dropbox.
4
5
  def resource
5
- @resource ||= DropboxApi::Metadata::Resource.new @data["metadata"]
6
+ @resource ||= DropboxApi::Metadata::Resource.new @data['metadata']
6
7
  end
7
8
  end
8
9
  end
@@ -1,14 +1,15 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class SaveUrlJobStatus < DropboxApi::Results::Base
3
4
  def self.new(result_data)
4
- case result_data[".tag"]
5
- when "in_progress"
5
+ case result_data['.tag']
6
+ when 'in_progress'
6
7
  :in_progress
7
- when "complete"
8
+ when 'complete'
8
9
  DropboxApi::Metadata::File.new result_data
9
- when "failed"
10
- DropboxApi::Errors::SaveUrlError.build("Async job failed",
11
- result_data["failed"])
10
+ when 'failed'
11
+ DropboxApi::Errors::SaveUrlError.build('Async job failed',
12
+ result_data['failed'])
12
13
  else
13
14
  raise NotImplementedError, "Unknown result type: #{result_data[".tag"]}"
14
15
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class SaveUrlResult < DropboxApi::Results::Base
3
4
  # Example with an async job:
@@ -8,7 +9,7 @@ module DropboxApi::Results
8
9
  #
9
10
  # I couldn't manage to get anything other than an async job.
10
11
  def async_job_id
11
- @data["async_job_id"]
12
+ @data['async_job_id']
12
13
  end
13
14
  end
14
15
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results::Search
2
3
  class Match
3
4
  def initialize(data)
@@ -5,11 +6,11 @@ module DropboxApi::Results::Search
5
6
  end
6
7
 
7
8
  def match_type
8
- @data["match_type"]
9
+ @data['match_type']
9
10
  end
10
11
 
11
12
  def resource
12
- @resource ||= DropboxApi::Metadata::Resource.new @data["metadata"]
13
+ @resource ||= DropboxApi::Metadata::Resource.new @data['metadata']
13
14
  end
14
15
  end
15
16
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ module DropboxApi::Results
3
+ class SearchV2Result < DropboxApi::Results::Base
4
+ # A list (possibly empty) of matches for the query.
5
+ def matches
6
+ @matches ||= @data['matches'].map do |match|
7
+ DropboxApi::Metadata::SearchMatchV2.new match
8
+ end
9
+ end
10
+
11
+ # Used for paging. If true, indicates there is another page of results
12
+ # available that can be fetched by calling search again.
13
+ def has_more?
14
+ @data['more'].to_s == 'true'
15
+ end
16
+
17
+ # Pass the cursor into #search_continue to fetch the next page of results
18
+ # (not yet implemented).
19
+ # This field is optional.
20
+ def cursor
21
+ @data['cursor']
22
+ end
23
+ end
24
+ end
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class ShareFolderLaunch
3
4
  def self.new(result_data)
4
- case result_data[".tag"]
5
- when "complete"
5
+ case result_data['.tag']
6
+ when 'complete'
6
7
  DropboxApi::Metadata::SharedFolder.new result_data
7
- when "async_job_id"
8
+ when 'async_job_id'
8
9
  result_data
9
10
  else
10
11
  raise ArgumentError, "Unable to infer resource type for `#{tag}`"
@@ -1,19 +1,20 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class SharedFileMembers < DropboxApi::Results::Base
3
4
  def users
4
- @data["users"]
5
+ @data['users']
5
6
  end
6
7
 
7
8
  def groups
8
- @data["groups"]
9
+ @data['groups']
9
10
  end
10
11
 
11
12
  def invitees
12
- @data["invitees"]
13
+ @data['invitees']
13
14
  end
14
15
 
15
16
  def cursor
16
- @data["cursor"]
17
+ @data['cursor']
17
18
  end
18
19
  end
19
20
  end
@@ -1,19 +1,20 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class SharedFolderMembers < DropboxApi::Results::Base
3
4
  def users
4
- @data["users"]
5
+ @data['users']
5
6
  end
6
7
 
7
8
  def groups
8
- @data["groups"]
9
+ @data['groups']
9
10
  end
10
11
 
11
12
  def invitees
12
- @data["invitees"]
13
+ @data['invitees']
13
14
  end
14
15
 
15
16
  def cursor
16
- @data["cursor"]
17
+ @data['cursor']
17
18
  end
18
19
  end
19
20
  end
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class UploadSessionStart < DropboxApi::Results::Base
3
4
  def session_id
4
- @data["session_id"]
5
+ @data['session_id']
5
6
  end
6
7
  end
7
8
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi::Results
2
3
  class VoidResult < DropboxApi::Results::Base
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module DropboxApi
2
- VERSION = '0.1.16'.freeze
3
+ VERSION = '0.1.19'
3
4
  end
data/lib/dropbox_api.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'dropbox_api/version'
2
3
 
3
4
  require 'time'
@@ -40,6 +41,16 @@ require 'dropbox_api/metadata/folder_sharing_info'
40
41
  require 'dropbox_api/metadata/folder'
41
42
  require 'dropbox_api/metadata/deleted'
42
43
  require 'dropbox_api/metadata/resource'
44
+ require 'dropbox_api/metadata/metadata_v2'
45
+ require 'dropbox_api/metadata/file_category'
46
+ require 'dropbox_api/metadata/file_categories_list'
47
+ require 'dropbox_api/metadata/file_extensions_list'
48
+ require 'dropbox_api/metadata/search_order_by'
49
+ require 'dropbox_api/metadata/file_status'
50
+ require 'dropbox_api/metadata/search_options'
51
+ require 'dropbox_api/metadata/search_match_type_v2'
52
+ require 'dropbox_api/metadata/search_match_v2'
53
+ require 'dropbox_api/metadata/search_match_field_options'
43
54
  require 'dropbox_api/metadata/shared_folder_policy'
44
55
  require 'dropbox_api/metadata/shared_folder'
45
56
  require 'dropbox_api/metadata/file_link_metadata'
@@ -71,9 +82,9 @@ require 'dropbox_api/errors/share_path_error'
71
82
  require 'dropbox_api/errors/share_folder_error'
72
83
  require 'dropbox_api/errors/get_copy_reference_error'
73
84
  require 'dropbox_api/errors/save_copy_reference_error'
85
+ require 'dropbox_api/errors/create_folder_batch_error'
74
86
  require 'dropbox_api/errors/create_folder_error'
75
87
  require 'dropbox_api/errors/create_shared_link_with_settings_error'
76
- require 'dropbox_api/errors/delete_error'
77
88
  require 'dropbox_api/errors/download_error'
78
89
  require 'dropbox_api/errors/sharing_file_access_error'
79
90
  require 'dropbox_api/errors/sharing_user_error'
@@ -98,14 +109,21 @@ require 'dropbox_api/errors/poll_error'
98
109
  require 'dropbox_api/errors/add_file_member_error'
99
110
  require 'dropbox_api/errors/add_folder_member_error'
100
111
  require 'dropbox_api/errors/too_many_requests_error'
112
+ require 'dropbox_api/errors/relocation_batch_entry_error'
101
113
  require 'dropbox_api/errors/get_account_error'
102
114
  require 'dropbox_api/errors/thumbnail_batch_error'
103
115
  require 'dropbox_api/errors/thumbnail_error'
104
116
  require 'dropbox_api/errors/create_file_request_error'
117
+ require 'dropbox_api/errors/delete_error'
105
118
 
106
119
  require 'dropbox_api/result_builder'
107
120
  require 'dropbox_api/results/base'
108
121
  require 'dropbox_api/results/basic_account_batch'
122
+ require 'dropbox_api/results/create_folder_batch_result'
123
+ require 'dropbox_api/results/create_folder_batch_result_entry'
124
+ require 'dropbox_api/results/relocation_batch_result'
125
+ require 'dropbox_api/results/relocation_batch_result_entry'
126
+ require 'dropbox_api/results/copy_batch_result'
109
127
  require 'dropbox_api/results/get_copy_reference_result'
110
128
  require 'dropbox_api/results/save_copy_reference_result'
111
129
  require 'dropbox_api/results/add_file_member_result_list'
@@ -118,13 +136,14 @@ require 'dropbox_api/results/list_folder_get_latest_cursor_result'
118
136
  require 'dropbox_api/results/list_shared_links_result'
119
137
  require 'dropbox_api/results/save_url_result'
120
138
  require 'dropbox_api/results/save_url_job_status'
121
- require 'dropbox_api/results/search/match'
122
- require 'dropbox_api/results/search_result'
139
+ require 'dropbox_api/results/search_v2_result'
123
140
  require 'dropbox_api/results/share_folder_launch'
124
141
  require 'dropbox_api/results/shared_file_members'
125
142
  require 'dropbox_api/results/shared_folder_members'
126
143
  require 'dropbox_api/results/void_result'
127
144
  require 'dropbox_api/results/upload_session_start'
145
+ require 'dropbox_api/results/delete_batch_result_entry'
146
+ require 'dropbox_api/results/delete_batch_result'
128
147
 
129
148
  require 'dropbox_api/client'
130
149
  require 'dropbox_api/connection_builder'
@@ -140,9 +159,12 @@ require 'dropbox_api/endpoints/content_upload'
140
159
  require 'dropbox_api/endpoints/auth/token_revoke'
141
160
 
142
161
  require 'dropbox_api/endpoints/files/copy'
162
+ require 'dropbox_api/endpoints/files/copy_batch_check'
163
+ require 'dropbox_api/endpoints/files/copy_batch'
143
164
  require 'dropbox_api/endpoints/files/copy_reference_get'
144
165
  require 'dropbox_api/endpoints/files/copy_reference_save'
145
166
  require 'dropbox_api/endpoints/files/create_folder'
167
+ require 'dropbox_api/endpoints/files/create_folder_batch'
146
168
  require 'dropbox_api/endpoints/files/delete'
147
169
  require 'dropbox_api/endpoints/files/download'
148
170
  require 'dropbox_api/endpoints/files/get_metadata'
@@ -165,6 +187,9 @@ require 'dropbox_api/endpoints/files/upload'
165
187
  require 'dropbox_api/endpoints/files/upload_session_start'
166
188
  require 'dropbox_api/endpoints/files/upload_session_append_v2'
167
189
  require 'dropbox_api/endpoints/files/upload_session_finish'
190
+ require 'dropbox_api/endpoints/files/delete_batch_check'
191
+ require 'dropbox_api/endpoints/files/delete_batch'
192
+ require 'dropbox_api/endpoints/files/create_folder_batch_check'
168
193
 
169
194
  require 'dropbox_api/endpoints/sharing/add_file_member'
170
195
  require 'dropbox_api/endpoints/sharing/list_file_members'