Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# unreleased changes
* API spec update 2026-09-30
* * very minor breaking changes: some things that were meant to be internal-only were removed
* API spec updates up to 2026-10-02 (dropbox/dropbox-api-spec#134)
* very minor breaking changes: some things that were meant to be internal-only were removed
* fixed a bug where non-ASCII characters in parameters were not properly escaped for upload and download routes

# v0.20.3
Expand Down
2 changes: 1 addition & 1 deletion dropbox-api-spec
3 changes: 3 additions & 0 deletions generator/rust.stoneg.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ def _impl_from_for_struct(self, struct: ir.Struct, parent: ir.Struct) -> None:
field_name = self.field_name(field)
attr = '#[allow(deprecated)] ' if field.deprecated else ''
self.emit(f'{attr}{field_name}: subtype.{field_name},')
self.emit()

# "extends" for polymorphic structs means it's one of the supertype's variants, so we can
# convert from the subtype to the supertype.
Expand All @@ -828,6 +829,7 @@ def _impl_from_for_polymorphic_struct(self, struct: ir.Struct, parent: ir.Struct
variant_name = self.enum_variant_name(subtype)
attr = '#[allow(deprecated)] ' if subtype.deprecated else ''
self.emit(f'{attr}{supertype}::{variant_name}(subtype)')
self.emit()

# "extends" for unions means the subtype adds additional variants, so we can convert from the
# supertype to the subtype.
Expand All @@ -843,6 +845,7 @@ def _impl_from_for_union(self, union: ir.Union, parent: ir.Union) -> None:
attr = '#[allow(deprecated)] ' if field.deprecated else ''
x = "" if isinstance(field.data_type, ir.Void) else "(x)"
self.emit(f'{attr}{supertype}::{variant_name}{x} => {subtype}::{variant_name}{x},')
self.emit()

# Helpers

Expand Down
188 changes: 188 additions & 0 deletions src/generated/async_routes/riviera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,62 @@
#[allow(unused_imports)]
pub use crate::generated::types::riviera::*;

/// Download the output of a completed `get_transform_async` job. Pass the `output_handle` from the
/// job's `complete` result. The body is the produced file, and the `Dropbox-API-Result` header
/// describes it. A handle can only be redeemed by the user who requested the transform, and only
/// until its `expires_ts`; after that this route fails with `expired_handle_error`, and the
/// transform has to be requested again. A handle that was never valid, or that belongs to another
/// user, fails with `user_error`.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn download_transform_output<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a DownloadTransformOutputArgs,
range_start: Option<u64>,
range_end: Option<u64>,
) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<DownloadTransformOutputResult>, crate::Error<TransformApiV2Error>>> + Send + 'a {
crate::client_helpers::request_with_body(
client,
crate::client_trait_common::Endpoint::Content,
crate::client_trait_common::Style::Download,
"riviera/download_transform_output",
arg,
None,
range_start,
range_end)
}

/// Download the output of a completed `get_transform_async` job. Pass the `output_handle` from the
/// job's `complete` result. The body is the produced file, and the `Dropbox-API-Result` header
/// describes it. A handle can only be redeemed by the user who requested the transform, and only
/// until its `expires_ts`; after that this route fails with `expired_handle_error`, and the
/// transform has to be requested again. A handle that was never valid, or that belongs to another
/// user, fails with `user_error`.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn download_transform_output_app_auth<'a>(
client: &'a impl crate::async_client_trait::AppAuthClient,
arg: &'a DownloadTransformOutputArgs,
range_start: Option<u64>,
range_end: Option<u64>,
) -> impl std::future::Future<Output=Result<crate::async_client_trait::HttpRequestResult<DownloadTransformOutputResult>, crate::Error<TransformApiV2Error>>> + Send + 'a {
crate::client_helpers::request_with_body(
client,
crate::client_trait_common::Endpoint::Content,
crate::client_trait_common::Style::Download,
"riviera/download_transform_output",
arg,
None,
range_start,
range_end)
}

/// Asynchronous scene-change keyframe extraction for video files. Detects scene changes in the
/// source video and returns one representative keyframe per detected scene, each tagged with its
/// timestamp (seconds from the start of the video) and scene-change score. Set `include_images =
Expand Down Expand Up @@ -572,3 +628,135 @@ pub fn get_transcript_async_check_app_auth<'a>(
None)
}

/// Asynchronous file transformation: produces a new file from an existing one. One route covers
/// many conversions. Name the source file in `file_id_or_url`, say what you want back in
/// `transform_type`, and supply that type's options message if it needs one: - `pdf`: documents and
/// images, to PDF. - `html`: spreadsheets, to HTML, preserving the sheet layout. - `image`: images
/// and single document pages, to JPEG or PNG. - `thumbnail`: any thumbnailable source, resized to a
/// named size bucket. - `image_pdf`: documents, to a page image rendered by way of PDF. -
/// `video_frame`: one still frame from a video, at a requested offset. The accepted input formats
/// differ per transform -- they are not one shared list -- and each is the intersection of the
/// source format with the pipeline that transform uses: - `pdf` and `image_pdf`: word-processing,
/// presentation and spreadsheet documents (.doc, .docx, .ppt, .pptx, .xls, .xlsx, .odt, .odp, .ods,
/// .rtf, .epub, .gdoc, .gslides, .hwp, .ai, .eps, .dwg among others). Images are not accepted. -
/// `html`: spreadsheets only -- .xls, .xlsm, .xlsx, .ods, .gsheet. This is the complete list. Note
/// that .csv and .txt are *not* accepted here. - `image`: the documents above, plus .pdf and .html,
/// plus the iWork and design formats .pages, .key, .numbers, .sketch, .xd, .indd and .psd, plus
/// .avif, .heic, .svg and camera RAW, plus fonts (.otf, .ttf), plus video. Formats a browser can
/// already display (.bmp, .gif, .ico, .jpeg, .png, .tif, .tiff, .webp) are not accepted; use
/// `thumbnail` for those. - `thumbnail`: everything `image` accepts, plus .bmp, .gif, .ico, .jpeg,
/// .png, .tif, .tiff, .webp and JPEG 2000. - `video_frame`: .3g2, .3gp, .3gpp, .3gpp2, .asf, .avi,
/// .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .ogv, .rm, .ts, .vob,
/// .webm, .wmv. This is the complete list. These lists track Riviera's capability registry
/// (`dropbox/riviera/supported_types/previews_supported_types.yaml`), which is generated and
/// authoritative; treat it rather than this comment as the final word. Formats the requested
/// transform does not support fail with `unsupported_format_error`. Options belonging to a
/// different transform type than the one requested fail with `invalid_options_error`. The produced
/// bytes are not returned by this route, and not by its `/check` poll either. Poll
/// `get_transform_async/check` with the returned async job ID until it reports `complete` or
/// `failed`; a `complete` result carries a `TransformOutput` whose `output_handle`
/// `download_transform_output` exchanges for the bytes. Splitting retrieval out this way is what
/// lets the route return outputs larger than an async result can carry.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn get_transform_async<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a TransformArgs,
) -> impl std::future::Future<Output=Result<crate::types::dbx_async::LaunchResultBase, crate::Error<crate::NoError>>> + Send + 'a {
crate::client_helpers::request(
client,
crate::client_trait_common::Endpoint::Api,
crate::client_trait_common::Style::Rpc,
"riviera/get_transform_async",
arg,
None)
}

/// Asynchronous file transformation: produces a new file from an existing one. One route covers
/// many conversions. Name the source file in `file_id_or_url`, say what you want back in
/// `transform_type`, and supply that type's options message if it needs one: - `pdf`: documents and
/// images, to PDF. - `html`: spreadsheets, to HTML, preserving the sheet layout. - `image`: images
/// and single document pages, to JPEG or PNG. - `thumbnail`: any thumbnailable source, resized to a
/// named size bucket. - `image_pdf`: documents, to a page image rendered by way of PDF. -
/// `video_frame`: one still frame from a video, at a requested offset. The accepted input formats
/// differ per transform -- they are not one shared list -- and each is the intersection of the
/// source format with the pipeline that transform uses: - `pdf` and `image_pdf`: word-processing,
/// presentation and spreadsheet documents (.doc, .docx, .ppt, .pptx, .xls, .xlsx, .odt, .odp, .ods,
/// .rtf, .epub, .gdoc, .gslides, .hwp, .ai, .eps, .dwg among others). Images are not accepted. -
/// `html`: spreadsheets only -- .xls, .xlsm, .xlsx, .ods, .gsheet. This is the complete list. Note
/// that .csv and .txt are *not* accepted here. - `image`: the documents above, plus .pdf and .html,
/// plus the iWork and design formats .pages, .key, .numbers, .sketch, .xd, .indd and .psd, plus
/// .avif, .heic, .svg and camera RAW, plus fonts (.otf, .ttf), plus video. Formats a browser can
/// already display (.bmp, .gif, .ico, .jpeg, .png, .tif, .tiff, .webp) are not accepted; use
/// `thumbnail` for those. - `thumbnail`: everything `image` accepts, plus .bmp, .gif, .ico, .jpeg,
/// .png, .tif, .tiff, .webp and JPEG 2000. - `video_frame`: .3g2, .3gp, .3gpp, .3gpp2, .asf, .avi,
/// .dv, .flv, .m2t, .m2ts, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .mxf, .ogv, .rm, .ts, .vob,
/// .webm, .wmv. This is the complete list. These lists track Riviera's capability registry
/// (`dropbox/riviera/supported_types/previews_supported_types.yaml`), which is generated and
/// authoritative; treat it rather than this comment as the final word. Formats the requested
/// transform does not support fail with `unsupported_format_error`. Options belonging to a
/// different transform type than the one requested fail with `invalid_options_error`. The produced
/// bytes are not returned by this route, and not by its `/check` poll either. Poll
/// `get_transform_async/check` with the returned async job ID until it reports `complete` or
/// `failed`; a `complete` result carries a `TransformOutput` whose `output_handle`
/// `download_transform_output` exchanges for the bytes. Splitting retrieval out this way is what
/// lets the route return outputs larger than an async result can carry.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn get_transform_async_app_auth<'a>(
client: &'a impl crate::async_client_trait::AppAuthClient,
arg: &'a TransformArgs,
) -> impl std::future::Future<Output=Result<crate::types::dbx_async::LaunchResultBase, crate::Error<crate::NoError>>> + Send + 'a {
crate::client_helpers::request(
client,
crate::client_trait_common::Endpoint::Api,
crate::client_trait_common::Style::Rpc,
"riviera/get_transform_async",
arg,
None)
}

/// Returns the status or result of specified get_transform_async task.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn get_transform_async_check<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a crate::types::dbx_async::PollArg,
) -> impl std::future::Future<Output=Result<GetTransformAsyncCheckResult, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
crate::client_helpers::request(
client,
crate::client_trait_common::Endpoint::Api,
crate::client_trait_common::Style::Rpc,
"riviera/get_transform_async/check",
arg,
None)
}

/// Returns the status or result of specified get_transform_async task.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn get_transform_async_check_app_auth<'a>(
client: &'a impl crate::async_client_trait::AppAuthClient,
arg: &'a crate::types::dbx_async::PollArg,
) -> impl std::future::Future<Output=Result<GetTransformAsyncCheckResult, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
crate::client_helpers::request(
client,
crate::client_trait_common::Endpoint::Api,
crate::client_trait_common::Style::Rpc,
"riviera/get_transform_async/check",
arg,
None)
}

28 changes: 28 additions & 0 deletions src/generated/async_routes/team.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,34 @@ pub fn members_suspend<'a>(
None)
}

/// Launch a member suspension batch. The server enforces a maximum of 500 members.
pub fn members_suspend_batch<'a>(
client: &'a impl crate::async_client_trait::TeamAuthClient,
arg: &'a MembersSuspendBatchArg,
) -> impl std::future::Future<Output=Result<crate::types::dbx_async::LaunchResultBase, crate::Error<MembersSuspendBatchError>>> + Send + 'a {
crate::client_helpers::request(
client,
crate::client_trait_common::Endpoint::Api,
crate::client_trait_common::Style::Rpc,
"team/members/suspend_batch",
arg,
None)
}

/// Poll a previously launched member suspension batch job.
pub fn members_suspend_batch_job_status_check<'a>(
client: &'a impl crate::async_client_trait::TeamAuthClient,
arg: &'a crate::types::dbx_async::PollArg,
) -> impl std::future::Future<Output=Result<MembersSuspendBatchJobStatus, crate::Error<crate::types::dbx_async::PollError>>> + Send + 'a {
crate::client_helpers::request(
client,
crate::client_trait_common::Endpoint::Api,
crate::client_trait_common::Style::Rpc,
"team/members/suspend_batch/job_status/check",
arg,
None)
}

/// Unsuspend a member from a team. Permission : Team member management Exactly one of
/// team_member_id, email, or external_id must be provided to identify the user account.
pub fn members_unsuspend<'a>(
Expand Down
Loading
Loading