dropbox-sdk 0.20.3

Rust bindings to the Dropbox API, generated by Stone from the official spec.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
namespace riviera

import async
import common

union TimestampLevel
    sentence
    word


struct MediaDurationError
    limit Int32 = 0

union ContentApiV2Error
    "Reason a transcript job failed. Returned in the `failed` variant of
    `GetTranscriptAsyncCheckResult`. This is a semantic error union: the HTTP
    status of the poll request itself is unaffected (a poll that surfaces a
    failed job is still a normal successful poll response). Callers should
    branch on the variant."
    server_error String = ""
        "An unexpected, typically transient, server-side failure. The string is a
        human-readable message; retrying with backoff may succeed."
    user_error String = ""
        "The request could not be processed as supplied (a problem with the
        caller's input). The string is a human-readable message; retrying the
        same request will not help."
    media_duration_error MediaDurationError
    no_audio_error
    link_download_disabled_error
    shared_link_password_protected
    limit_exceeded_error
    not_found_error
        "The referenced file does not exist or is not accessible."
    is_a_folder_error
        "The target is a folder, not a file."

union FileIdOrUrl
    file_id String = ""
        "A Dropbox-issued file id (format: \"id:<id>\") for a file the
        authenticated user has access to."
    url String = ""
        "Either a Dropbox shared link (www.dropbox.com) or an external HTTP or
        HTTPS URL pointing to a supported file.
        - Dropbox shared links are resolved internally using the caller's
        authenticated identity and the link's visibility / download
        settings. They therefore require an authenticated user context
        (anonymous `url` requests against Dropbox links are rejected with an
        `access_error`). Links protected by a password are rejected with
        `shared_link_password_protected`; links with downloads disabled are
        rejected with `link_download_disabled_error`.
        - External URLs are fetched through the backend's egress proxy and must
        point at a supported file extension."
    path String = ""
        "An absolute Dropbox path, e.g. \"/folder/example.pdf\"."

    example default
        path = "/folder/example.pdf"

struct GetTranscriptArgs
    "Arguments for the asynchronous `get_transcript_async` route.
    Exactly one of `file_id`, `path`, or `url` must be supplied via
    `file_id_or_url` to identify the audio or video asset to transcribe."
    file_id_or_url FileIdOrUrl?
        "Identifier of the media asset to transcribe. Callers must set exactly one
        of the `FileIdOrUrl` variants. The referenced asset must be an audio or
        video file in a supported format (see the route description for the list);
        requests against files with no audio track return a `no_audio_error`."
    timestamp_level TimestampLevel = sentence
        "Granularity of the time offsets returned for each transcript segment.
        Defaults to `SENTENCE` when the field is omitted.
        - SENTENCE: one segment per spoken sentence (recommended).
        - WORD: one segment per word, useful for fine-grained alignment such
        as captioning or highlight-as-you-listen experiences."
    included_special_words String = ""
        "Comma-delimited list of non-lexical filler words to preserve in the
        transcript output, e.g. `\"uh, ah, uhm\"`. By default these fillers are
        stripped. Unrecognized tokens are ignored. Leave empty to use the
        default filtering behavior."
    audio_language String = ""
        "Optional ISO 639-1 two-letter language code hinting the spoken language of
        the source audio (e.g. \"en\", \"ja\"). When empty, the service auto-detects
        the language; supplying a hint improves accuracy and latency for short or
        ambiguous clips. Unsupported languages fall back to auto-detection."

    example default
        file_id_or_url = default
        timestamp_level = sentence

struct ApiTranscriptSegment
    "Transcript segment for APIv2"
    text String = ""
    start_time Float64 = 0
    end_time Float64 = 0

struct ApiStructuredTranscript
    "Structured transcript for APIv2"
    segments List(ApiTranscriptSegment)?
    transcript_locale String = ""

struct GetTranscriptResult
    structured_transcript ApiStructuredTranscript?
        "The structured transcript produced for the requested media asset, with
        per-segment text, start/end offsets (in seconds from the beginning of
        the media), and the detected or caller-supplied locale."

union GetTranscriptAsyncCheckResult
    "Result type for EventBus async check - must end in \"CheckResult\""
    in_progress
    complete GetTranscriptResult
    failed ContentApiV2Error

route get_transcript_async (GetTranscriptArgs, async.LaunchResultBase, Void)
    "Asynchronous transcript generation for audio and video files.
    Supported audio formats: .aac, .aif, .aiff, .flac, .m4a, .m4r, .mp3, .oga,
    .ogg, .wav, .wma. Supported video formats: .3gp, .3gpp, .3gpp2, .asf, .avi,
    .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf,
    .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv. Unsupported formats return
    an `unsupported_format_error`.
    Size limits: the source file must be at most 10 GB and its audio track at
    most 1 hour in duration. Files exceeding these limits are rejected."

    attrs
        auth = "app, user"
        is_preview = true
        scope = "files.content.read"

route get_transcript_async/check (async.PollArg, GetTranscriptAsyncCheckResult, async.PollError)
    "Returns the status or result of specified get_transcript_async task."

    attrs
        auth = "app, user"
        is_preview = true
        scope = "files.content.read"


struct GetMarkdownArgs
    "Arguments for the asynchronous `get_markdown_async` route.
    Exactly one of `file_id`, `path`, or `url` must be supplied via
    `file_id_or_url` to identify the document to convert to markdown."
    file_id_or_url FileIdOrUrl?
        "Identifier of the document to convert. Callers must set exactly one of the
        `FileIdOrUrl` variants. The referenced file must be a document in a
        supported format (see the route description for the list); requests
        against unsupported formats return `unsupported_format_error`."
    enable_ocr Boolean = false
        "Enable OCR for PDF documents. Processing is slower when enabled."
    embed_images Boolean = false
        "When true, embed images as base64 data URIs in the markdown output.
        This can significantly increase output size."

    example default
        file_id_or_url = default
        enable_ocr = false
        embed_images = false

struct GetMarkdownResult
    markdown String = ""
        "The converted markdown content"

union MarkdownConversionApiV2Error
    "Reason a markdown conversion job failed. Returned in the `failed` variant of
    `GetMarkdownAsyncCheckResult`. This is a semantic error union: the HTTP
    status of the poll request itself is unaffected (a poll that surfaces a
    failed job is still a normal successful poll response). Callers should
    branch on the variant."
    server_error String = ""
        "An unexpected, typically transient, server-side failure. The string is a
        human-readable message; retrying with backoff may succeed."
    user_error String = ""
        "The request could not be processed as supplied (a problem with the
        caller's input). The string is a human-readable message; retrying the
        same request will not help."
    unsupported_format_error
    link_download_disabled_error
    shared_link_password_protected
    limit_exceeded_error
    conversion_failure_error
    not_found_error
        "The referenced file does not exist or is not accessible."
    is_a_folder_error
        "The target is a folder, not a file."

union GetMarkdownAsyncCheckResult
    "Result type for EventBus async check"
    in_progress
    complete GetMarkdownResult
    failed MarkdownConversionApiV2Error

route get_markdown_async (GetMarkdownArgs, async.LaunchResultBase, Void)
    "Asynchronous document-to-markdown conversion for supported file formats.
    Supported formats: .binder, .docx, .html, .paper, .papert, .pptx, .xlsx,
    .gsheet, .ods, .pdf. Unsupported formats return an
    `unsupported_format_error`.
    Size limit: the source file must be at most 50 MB. Larger files are
    rejected."

    attrs
        auth = "app, user"
        is_preview = true
        scope = "files.content.read"

route get_markdown_async/check (async.PollArg, GetMarkdownAsyncCheckResult, async.PollError)
    "Returns the status or result of specified get_markdown_async task."

    attrs
        auth = "app, user"
        is_preview = true
        scope = "files.content.read"


union OfficeFileType
    "The kind of MS Office document that produced an `ApiOfficeMetadata` result."
    office_filetype_unknown
    office_filetype_word
    office_filetype_powerpoint
    office_filetype_excel


union MetadataType
    "Which metadata variant is populated in a `GetMetadataResult`, derived from
    the file type."
    metadata_type_unknown
    metadata_type_exif
    metadata_type_media
    metadata_type_pdf
    metadata_type_office


struct GetMetadataArgs
    "Arguments for the asynchronous `get_metadata_async` route.
    Exactly one of `file_id`, `path`, or `url` must be supplied via
    `file_id_or_url` to identify the file whose metadata should be extracted."
    file_id_or_url FileIdOrUrl?
        "Identifier of the file to extract metadata from. Callers must set exactly
        one of the `FileIdOrUrl` variants. The kind of metadata returned is
        determined by the file type: image files return EXIF metadata, audio/video
        files return media metadata, PDFs return PDF metadata, and MS Office
        documents (docx, pptx, xlsx) return Office metadata. See the route
        description for the supported formats. Requests against unsupported formats
        return `unsupported_format_error`."

    example default
        file_id_or_url = default

struct ApiExifGpsMetadata
    "GPS coordinates and related tags extracted from image EXIF data. Fields are
    populated on a best-effort basis and may be empty when absent from the
    source file."
    latitude Float32 = 0
        "Latitude / longitude in decimal degrees (positive = N/E, negative = S/W)."
    longitude Float32 = 0
    altitude String = ""
        "Altitude in meters, as reported by the source (string to preserve the
        original representation, which may include a reference direction)."
    timestamp String = ""
        "Timestamp / datestamp of the GPS fix, in the EXIF-provided format."
    datestamp String = ""

struct ApiExifMetadata
    "Image EXIF metadata. Mirrors the useful subset of the internal
    `riviera.ExifMetadata` message. Fields are best-effort and may be empty."
    image_width UInt32 = 0
    image_height UInt32 = 0
    camera_make String = ""
    camera_model String = ""
    lens_model String = ""
    date_time_original String = ""
        "Capture time in the EXIF-provided format (local time of the camera)."
    offset_time_original String = ""
        "Timezone offset for `date_time_original`, e.g. \"+09:00\"."
    orientation UInt32 = 0
        "EXIF orientation value (1-8). See the EXIF spec; 1 is the normal
        upright orientation."
    exposure_time String = ""
        "fraction in string form, e.g. \"1/250\""
    aperture_value Float64 = 0
    iso_speed UInt32 = 0
    focal_length String = ""
        "e.g. \"26.0 mm\""
    megapixels Float64 = 0
    artist String = ""
    copyright String = ""
    gps_metadata ApiExifGpsMetadata?

struct ApiMediaStream
    "A single audio or video stream within a media file."
    index UInt32 = 0
    codec_type String = ""
        "\"audio\", \"video\", etc."
    codec_name String = ""
    bitrate_bps UInt64 = 0
    duration_s Float64 = 0
    width UInt32 = 0
        "Video-specific fields (zero / empty for audio streams)."
    height UInt32 = 0
    frames_per_second Float64 = 0
    rotation Int32 = 0
    display_aspect_ratio String = ""
        "e.g. \"16:9\""
    channels UInt32 = 0
        "Audio-specific fields (zero / empty for video streams)."
    channel_layout String = ""
    sample_rate_s UInt64 = 0
    language_iso_639 String = ""
        "ISO 639 language code for the stream, when present."

struct ApiMediaMetadata
    "Audio/video container and per-stream metadata. Mirrors the useful subset of
    the internal `riviera.MediaMetadata` message."
    bitrate_bps UInt64 = 0
    duration_s Float64 = 0
    creation_time String = ""
        "Container-level creation time, when present."
    streams List(ApiMediaStream)?

struct ApiPdfMetadata
    "PDF document metadata."
    pages UInt32 = 0
    width UInt32 = 0
        "Width / height of the first page, in PDF points."
    height UInt32 = 0

struct ApiOfficeMetadata
    "MS Office document metadata. Mirrors the internal `riviera.OfficeMetadata`
    message. Some fields apply only to specific document types (e.g. `slides`
    for PowerPoint, `words`/`pages` for Word)."
    file_type OfficeFileType = office_filetype_unknown
    creator String = ""
    company String = ""
    title String = ""
    subject String = ""
    keywords String = ""
    description String = ""
    total_edit_time_minutes UInt32 = 0
    pages UInt32 = 0
        "Word only."
    words UInt32 = 0
    slides UInt32 = 0
        "PowerPoint only."
    revision_number String = ""

struct GetMetadataResult
    metadata_type MetadataType = metadata_type_unknown
        "The kind of metadata that was extracted for the requested file. Callers
        should read the matching field of the `metadata` oneof."
    metadata metadata_union?
        union
            "Exactly one variant is populated, corresponding to `metadata_type`."
            exif ApiExifMetadata
            media ApiMediaMetadata
            pdf ApiPdfMetadata
            office ApiOfficeMetadata

union MetadataExtractionApiV2Error
    "Reason a metadata extraction job failed. Returned in the `failed` variant of
    `GetMetadataAsyncCheckResult`. This is a semantic error union: the HTTP
    status of the poll request itself is unaffected (a poll that surfaces a
    failed job is still a normal successful poll response). Callers should
    branch on the variant."
    server_error String = ""
        "An unexpected, typically transient, server-side failure. The string is a
        human-readable message; retrying with backoff may succeed."
    user_error String = ""
        "The request could not be processed as supplied (a problem with the
        caller's input). The string is a human-readable message; retrying the
        same request will not help."
    unsupported_format_error
    link_download_disabled_error
    shared_link_password_protected
    limit_exceeded_error
    conversion_failure_error
    not_found_error
        "The referenced file does not exist or is not accessible."
    is_a_folder_error
        "The target is a folder, not a file."

union GetMetadataAsyncCheckResult
    "Result type for EventBus async check - must end in \"CheckResult\""
    in_progress
    complete GetMetadataResult
    failed MetadataExtractionApiV2Error

route get_metadata_async (GetMetadataArgs, async.LaunchResultBase, Void)
    "Asynchronous file metadata extraction for supported file formats. The kind
    of metadata returned depends on the file type:
    - Image (EXIF) formats: .3fr, .arw, .avif, .bmp, .cr2, .cr3, .crw, .dcr,
    .dcs, .dng, .erf, .gif, .heic, .j2c, .j2k, .jp2, .jpc, .jpeg, .jpf,
    .jpg, .jpg2, .jpm, .jpx, .kdc, .mef, .mos, .mrw, .nef, .nrw, .orf,
    .pef, .png, .ppm, .r3d, .raf, .rw2, .rwl, .sr2, .tga, .tif, .tiff,
    .wbmp, .web, .webp, .x3f.
    - Audio/video (media) formats: .aac, .aif, .aiff, .flac, .m4a, .m4r,
    .mp3, .oga, .ogg, .wav, .wma, .3gp, .3gpp, .3gpp2, .asf, .avi, .dv,
    .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf,
    .oggtheora, .ogv, .rm, .ts, .vob, .webm, .wmv.
    - PDF format: .pdf.
    - MS Office formats: .docx, .pptx, .xlsx.
    Unsupported formats return an `unsupported_format_error`."

    attrs
        auth = "app, user"
        is_preview = true
        scope = "files.content.read"

route get_metadata_async/check (async.PollArg, GetMetadataAsyncCheckResult, async.PollError)
    "Returns the status or result of specified get_metadata_async task."

    attrs
        auth = "app, user"
        is_preview = true
        scope = "files.content.read"