@@ -3,6 +3,7 @@ namespace files
3
3
4
4
import common
5
5
import users
6
+ import properties
6
7
7
8
alias Id = String(min_length=1)
8
9
alias Path = String(pattern="/.*")
@@ -176,6 +177,16 @@ struct FileMetadata extends Metadata
176
177
"Additional information if the file is a photo or video."
177
178
sharing_info FileSharingInfo?
178
179
"Set if this file is contained in a shared folder."
180
+ property_groups List(properties.PropertyGroup)?
181
+ "Additional information if the file has custom properties with the
182
+ property template specified."
183
+ has_explicit_shared_members Boolean?
184
+ "This flag will only be present if include_has_explicit_shared_members
185
+ is true in :route:`list_folder` or :route:`get_metadata`. If this
186
+ flag is present, it will be true if this file has any explicit shared
187
+ members. This is different from sharing_info in that this could be true
188
+ in the case where a file has explicit members but is not contained within
189
+ a shared folder."
179
190
180
191
example default
181
192
id = "id:a4ayc_80_OEAAAAAAAAAXw"
@@ -187,6 +198,8 @@ struct FileMetadata extends Metadata
187
198
server_modified = "2015-05-12T15:50:38Z"
188
199
rev = "a1c10ce0dd78"
189
200
size = 7212
201
+ property_groups = [default]
202
+ has_explicit_shared_members = false
190
203
191
204
struct FolderMetadata extends Metadata
192
205
id Id
@@ -195,13 +208,17 @@ struct FolderMetadata extends Metadata
195
208
"Deprecated. Please use :field:`sharing_info` instead."
196
209
sharing_info FolderSharingInfo?
197
210
"Set if the folder is contained in a shared folder or is a shared folder mount point."
211
+ property_groups List(properties.PropertyGroup)?
212
+ "Additional information if the file has custom properties with the
213
+ property template specified."
198
214
199
215
example default
200
216
id = "id:a4ayc_80_OEAAAAAAAAAXz"
201
217
path_lower = "/homework/math"
202
218
path_display = "/Homework/math"
203
219
name = "math"
204
220
sharing_info = default
221
+ property_groups = [default]
205
222
206
223
struct DeletedMetadata extends Metadata
207
224
"Indicates that there used to be a file or folder at this path, but it no longer exists."
@@ -221,6 +238,12 @@ struct GetMetadataArg
221
238
"The path of a file or folder on Dropbox."
222
239
include_media_info Boolean = false
223
240
"If true, :field:`FileMetadata.media_info` is set for photo and video."
241
+ include_deleted Boolean = false
242
+ "If true, :type:`DeletedMetadata` will be returned for deleted file or
243
+ folder, otherwise :field:`LookupError.not_found` will be returned."
244
+ include_has_explicit_shared_members Boolean = false
245
+ "If true, the results will include a flag for each file indicating whether or not
246
+ that file has any explicit members."
224
247
225
248
example default
226
249
path = "/Homework/math"
@@ -294,6 +317,9 @@ struct ListFolderArg
294
317
"If true, :field:`FileMetadata.media_info` is set for photo and video."
295
318
include_deleted Boolean = false
296
319
"If true, the results will include entries for files and folders that used to exist but were deleted."
320
+ include_has_explicit_shared_members Boolean = false
321
+ "If true, the results will include a flag for each file indicating whether or not
322
+ that file has any explicit members."
297
323
298
324
example default
299
325
path = "/Homework/math"
@@ -419,6 +445,8 @@ union UploadSessionLookupError
419
445
closed
420
446
"You are attempting to append data to an upload session that
421
447
has alread been closed (i.e. committed)."
448
+ not_closed
449
+ "The session must be closed before calling upload_session/finish_batch."
422
450
other*
423
451
"An unspecified error."
424
452
@@ -427,11 +455,22 @@ union UploadSessionFinishError
427
455
"The session arguments are incorrect; the value explains the reason."
428
456
path WriteError
429
457
"Unable to save the uploaded contents to a file."
458
+ too_many_shared_folder_targets
459
+ "The batch request commits files into too many different shared folders.
460
+ Please limit your batch request to files contained in a single shared folder."
430
461
other*
431
462
"An unspecified error."
432
463
433
464
# Req/Resp
434
465
466
+ struct UploadSessionStartArg
467
+ close Boolean = false
468
+ "If true, current session will be closed. You cannot do
469
+ :route:`upload_session/append` any more to current session"
470
+
471
+ example with_close
472
+ close = true
473
+
435
474
struct UploadSessionStartResult
436
475
session_id String
437
476
"A unique identifier for the upload session. Pass this to
@@ -441,7 +480,7 @@ struct UploadSessionStartResult
441
480
example default
442
481
session_id = "1234faaf0678bcde"
443
482
444
- route upload_session/start (Void , UploadSessionStartResult, Void)
483
+ route upload_session/start (UploadSessionStartArg , UploadSessionStartResult, Void)
445
484
"Upload sessions allow you to upload a single file using multiple requests.
446
485
This call starts a new upload session with the given data. You can
447
486
then use :route:`upload_session/append` to add more data and
@@ -453,6 +492,28 @@ route upload_session/start (Void, UploadSessionStartResult, Void)
453
492
host="content"
454
493
style="upload"
455
494
495
+ struct UploadSessionAppendArg
496
+ cursor UploadSessionCursor
497
+ "Contains the upload session ID and the offset."
498
+ close Boolean = false
499
+ "If true, current session will be closed. You cannot do
500
+ :route:`upload_session/append` any more to current session"
501
+
502
+ example default
503
+ cursor = default
504
+
505
+ route upload_session/append_v2 (UploadSessionAppendArg, Void, UploadSessionLookupError)
506
+ "Append more data to an upload session.
507
+
508
+ When the parameter close is set, this call will close the session.
509
+
510
+ A single request should not upload more than 150 MB of file contents."
511
+
512
+ attrs
513
+ host="content"
514
+ style="upload"
515
+
516
+
456
517
struct UploadSessionCursor
457
518
session_id String
458
519
"The upload session ID (returned by :route:`upload_session/start`)."
@@ -465,7 +526,7 @@ struct UploadSessionCursor
465
526
session_id = "1234faaf0678bcde"
466
527
offset = 0
467
528
468
- route upload_session/append (UploadSessionCursor, Void, UploadSessionLookupError)
529
+ route upload_session/append (UploadSessionCursor, Void, UploadSessionLookupError) deprecated by upload_session/append_v2
469
530
"Append more data to an upload session.
470
531
471
532
A single request should not upload more than 150 MB of file contents."
@@ -660,7 +721,9 @@ union SearchError
660
721
"An unspecified error."
661
722
662
723
route search (SearchArg, SearchResult, SearchError)
663
- "Searches for files and folders."
724
+ "Searches for files and folders.
725
+
726
+ Note: Recent changes may not immediately be reflected in search results due to a short delay in indexing."
664
727
665
728
#
666
729
# Errors shared by various operations
@@ -961,3 +1024,103 @@ union RestoreError
961
1024
962
1025
route restore(RestoreArg, FileMetadata, RestoreError)
963
1026
"Restore a file to a specific revision"
1027
+
1028
+
1029
+ #
1030
+ # Temporary link
1031
+ #
1032
+
1033
+ struct GetTemporaryLinkArg
1034
+ path ReadPath
1035
+ "The path to the file you want a temporary link to."
1036
+
1037
+ example default
1038
+ path = "/video.mp4"
1039
+
1040
+ struct GetTemporaryLinkResult
1041
+ metadata FileMetadata
1042
+ "Metadata of the file."
1043
+ link String
1044
+ "The temporary link which can be used to stream content the file."
1045
+
1046
+ example default
1047
+ metadata = default
1048
+ link = "https://dl.dropboxusercontent.com/apitl/1/YXNkZmFzZGcyMzQyMzI0NjU2NDU2NDU2"
1049
+
1050
+ union GetTemporaryLinkError
1051
+ path LookupError
1052
+
1053
+ other*
1054
+
1055
+ route get_temporary_link(GetTemporaryLinkArg, GetTemporaryLinkResult, GetTemporaryLinkError)
1056
+ "Get a temporary link to stream content of a file. This link will expire in four hours and
1057
+ afterwards you will get 410 Gone. Content-Type of the link is determined automatically by
1058
+ the file's mime type."
1059
+
1060
+
1061
+ #
1062
+ # Copy reference
1063
+ #
1064
+
1065
+ struct GetCopyReferenceArg
1066
+ path ReadPath
1067
+ "The path to the file or folder you want to get a copy reference to."
1068
+
1069
+ example default
1070
+ path = "/video.mp4"
1071
+
1072
+ struct GetCopyReferenceResult
1073
+ metadata Metadata
1074
+ "Metadata of the file or folder."
1075
+ copy_reference String
1076
+ "A copy reference to the file or folder."
1077
+ expires common.DropboxTimestamp
1078
+ "The expiration date of the copy reference. This value is currently set to be
1079
+ far enough in the future so that expiration is effectively not an issue."
1080
+
1081
+ example default
1082
+ metadata = default
1083
+ copy_reference = "z1X6ATl6aWtzOGq0c3g5Ng"
1084
+ expires = "2045-05-12T15:50:38Z"
1085
+
1086
+ union GetCopyReferenceError
1087
+ path LookupError
1088
+ other*
1089
+
1090
+ route copy_reference/get(GetCopyReferenceArg, GetCopyReferenceResult, GetCopyReferenceError)
1091
+ "Get a copy reference to a file or folder. This reference string can be used to
1092
+ save that file or folder to another user's Dropbox by passing it to
1093
+ :route:`copy_reference/save`."
1094
+
1095
+ struct SaveCopyReferenceArg
1096
+ copy_reference String
1097
+ "A copy reference returned by :route:`copy_reference/get`."
1098
+
1099
+ path Path
1100
+ "Path in the user's Dropbox that is the destination."
1101
+
1102
+ example default
1103
+ copy_reference = "z1X6ATl6aWtzOGq0c3g5Ng"
1104
+ path = "/video.mp4"
1105
+
1106
+ struct SaveCopyReferenceResult
1107
+ metadata Metadata
1108
+ "The metadata of the saved file or folder in the user's Dropbox."
1109
+
1110
+ example default
1111
+ metadata = default
1112
+
1113
+ union SaveCopyReferenceError
1114
+ path WriteError
1115
+ invalid_copy_reference
1116
+ "The copy reference is invalid."
1117
+ no_permission
1118
+ "The app has no permission to access another user's Dropbox."
1119
+ not_found
1120
+ "The file referenced by the copy reference cannot be found."
1121
+ too_many_files
1122
+ "The operation would involve more than 10,000 files and folders."
1123
+ other*
1124
+
1125
+ route copy_reference/save(SaveCopyReferenceArg, SaveCopyReferenceResult, SaveCopyReferenceError)
1126
+ "Save a copy reference returned by :route:`copy_reference/get` to the user's Dropbox."
0 commit comments