Skip to content

Commit

Permalink
remove redundant intra-doc link targets from generated doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wfraser committed Dec 4, 2024
1 parent 70cb6e0 commit d909b84
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 268 deletions.
4 changes: 2 additions & 2 deletions generator/rust.stoneg.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def _docf(self, tag: str, val: str) -> str:
field = self.field_name_raw(field)
return f'`{field}`'
field = self.enum_variant_name_raw(field)
return f'[`{type_name}::{field}`]({type_name}::{field})'
return f'[`{type_name}::{field}`]'
else:
field = self.field_name_raw(field)
# we can't link to the field itself, so just link to the struct
Expand All @@ -894,7 +894,7 @@ def _docf(self, tag: str, val: str) -> str:
else:
typ = self._all_types[self._current_namespace][val]
rust_name = self._rust_type(typ)
return f'[`{rust_name}`]({rust_name})'
return f'[`{rust_name}`]'
elif tag == 'link':
title, url = val.rsplit(' ', 1)
return f'[{title}]({url})'
Expand Down
97 changes: 45 additions & 52 deletions src/generated/async_routes/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ pub fn create_folder_batch_check<'a>(

/// Delete the file or folder at a given path. If the path is a folder, all its contents will be
/// deleted too. A successful response indicates that the file or folder was deleted. The returned
/// metadata will be the corresponding [`FileMetadata`](FileMetadata) or
/// [`FolderMetadata`](FolderMetadata) for the item at time of deletion, and not a
/// [`DeletedMetadata`](DeletedMetadata) object.
/// metadata will be the corresponding [`FileMetadata`] or [`FolderMetadata`] for the item at time
/// of deletion, and not a [`DeletedMetadata`] object.
pub fn delete_v2<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a DeleteArg,
Expand All @@ -269,9 +268,8 @@ pub fn delete_v2<'a>(

/// Delete the file or folder at a given path. If the path is a folder, all its contents will be
/// deleted too. A successful response indicates that the file or folder was deleted. The returned
/// metadata will be the corresponding [`FileMetadata`](FileMetadata) or
/// [`FolderMetadata`](FolderMetadata) for the item at time of deletion, and not a
/// [`DeletedMetadata`](DeletedMetadata) object.
/// metadata will be the corresponding [`FileMetadata`] or [`FolderMetadata`] for the item at time
/// of deletion, and not a [`DeletedMetadata`] object.
#[deprecated(note = "replaced by delete_v2")]
pub fn delete<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
Expand Down Expand Up @@ -451,14 +449,13 @@ pub fn get_temporary_link<'a>(
///
/// This endpoint acts as a delayed [`upload()`](crate::files::upload). The returned temporary
/// upload link may be used to make a POST request with the data to be uploaded. The upload will
/// then be perfomed with the [`CommitInfo`](CommitInfo) previously provided to
/// then be perfomed with the [`CommitInfo`] previously provided to
/// [`get_temporary_upload_link()`](crate::files::get_temporary_upload_link) but evaluated only upon
/// consumption. Hence, errors stemming from invalid [`CommitInfo`](CommitInfo) with respect to the
/// state of the user's Dropbox will only be communicated at consumption time. Additionally, these
/// errors are surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details.
/// The maximum temporary upload link duration is 4 hours. Upon consumption or expiration, a new
/// link will have to be generated. Multiple links may exist for a specific upload path at any given
/// time.
/// consumption. Hence, errors stemming from invalid [`CommitInfo`] with respect to the state of the
/// user's Dropbox will only be communicated at consumption time. Additionally, these errors are
/// surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum
/// temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have
/// to be generated. Multiple links may exist for a specific upload path at any given time.
///
/// The POST request on the temporary upload link must have its Content-Type set to
/// "application/octet-stream".
Expand Down Expand Up @@ -579,17 +576,17 @@ pub fn get_thumbnail_batch<'a>(
/// [`ListFolderResult::cursor`](ListFolderResult) to retrieve more entries. If you're using
/// [`ListFolderArg::recursive`](ListFolderArg) set to `true` to keep a local cache of the contents
/// of a Dropbox account, iterate through each entry in order and process them as follows to keep
/// your local state in sync: For each [`FileMetadata`](FileMetadata), store the new entry at the
/// given path in your local state. If the required parent folders don't exist yet, create them. If
/// there's already something else at the given path, replace it and remove all its children. For
/// each [`FolderMetadata`](FolderMetadata), store the new entry at the given path in your local
/// state. If the required parent folders don't exist yet, create them. If there's already something
/// else at the given path, replace it but leave the children as they are. Check the new entry's
/// your local state in sync: For each [`FileMetadata`], store the new entry at the given path in
/// your local state. If the required parent folders don't exist yet, create them. If there's
/// already something else at the given path, replace it and remove all its children. For each
/// [`FolderMetadata`], store the new entry at the given path in your local state. If the required
/// parent folders don't exist yet, create them. If there's already something else at the given
/// path, replace it but leave the children as they are. Check the new entry's
/// [`FolderSharingInfo::read_only`](FolderSharingInfo) and set all its children's read-only
/// statuses to match. For each [`DeletedMetadata`](DeletedMetadata), if your local state has
/// something at the given path, remove it and all its children. If there's nothing at the given
/// path, ignore this entry. Note: [`auth::RateLimitError`](crate::types::auth::RateLimitError) may
/// be returned if multiple [`list_folder()`](crate::files::list_folder) or
/// statuses to match. For each [`DeletedMetadata`], if your local state has something at the given
/// path, remove it and all its children. If there's nothing at the given path, ignore this entry.
/// Note: [`auth::RateLimitError`](crate::types::auth::RateLimitError) may be returned if multiple
/// [`list_folder()`](crate::files::list_folder) or
/// [`list_folder_continue()`](crate::files::list_folder_continue) calls with same parameters are
/// made simultaneously by same API app for same user. If your app implements retry logic, please
/// hold off the retry until the previous request finishes.
Expand All @@ -612,17 +609,17 @@ pub fn list_folder<'a>(
/// [`ListFolderResult::cursor`](ListFolderResult) to retrieve more entries. If you're using
/// [`ListFolderArg::recursive`](ListFolderArg) set to `true` to keep a local cache of the contents
/// of a Dropbox account, iterate through each entry in order and process them as follows to keep
/// your local state in sync: For each [`FileMetadata`](FileMetadata), store the new entry at the
/// given path in your local state. If the required parent folders don't exist yet, create them. If
/// there's already something else at the given path, replace it and remove all its children. For
/// each [`FolderMetadata`](FolderMetadata), store the new entry at the given path in your local
/// state. If the required parent folders don't exist yet, create them. If there's already something
/// else at the given path, replace it but leave the children as they are. Check the new entry's
/// your local state in sync: For each [`FileMetadata`], store the new entry at the given path in
/// your local state. If the required parent folders don't exist yet, create them. If there's
/// already something else at the given path, replace it and remove all its children. For each
/// [`FolderMetadata`], store the new entry at the given path in your local state. If the required
/// parent folders don't exist yet, create them. If there's already something else at the given
/// path, replace it but leave the children as they are. Check the new entry's
/// [`FolderSharingInfo::read_only`](FolderSharingInfo) and set all its children's read-only
/// statuses to match. For each [`DeletedMetadata`](DeletedMetadata), if your local state has
/// something at the given path, remove it and all its children. If there's nothing at the given
/// path, ignore this entry. Note: [`auth::RateLimitError`](crate::types::auth::RateLimitError) may
/// be returned if multiple [`list_folder()`](crate::files::list_folder) or
/// statuses to match. For each [`DeletedMetadata`], if your local state has something at the given
/// path, remove it and all its children. If there's nothing at the given path, ignore this entry.
/// Note: [`auth::RateLimitError`](crate::types::auth::RateLimitError) may be returned if multiple
/// [`list_folder()`](crate::files::list_folder) or
/// [`list_folder_continue()`](crate::files::list_folder_continue) calls with same parameters are
/// made simultaneously by same API app for same user. If your app implements retry logic, please
/// hold off the retry until the previous request finishes.
Expand Down Expand Up @@ -711,11 +708,10 @@ pub fn list_folder_longpoll<'a>(
/// Returns revisions for files based on a file path or a file id. The file path or file id is
/// identified from the latest file entry at the given file path or id. This end point allows your
/// app to query either by file path or file id by setting the mode parameter appropriately. In the
/// [`ListRevisionsMode::Path`](ListRevisionsMode::Path) (default) mode, all revisions at the same
/// file path as the latest file entry are returned. If revisions with the same file id are desired,
/// then mode must be set to [`ListRevisionsMode::Id`](ListRevisionsMode::Id). The
/// [`ListRevisionsMode::Id`](ListRevisionsMode::Id) mode is useful to retrieve revisions for a
/// given file across moves or renames.
/// [`ListRevisionsMode::Path`] (default) mode, all revisions at the same file path as the latest
/// file entry are returned. If revisions with the same file id are desired, then mode must be set
/// to [`ListRevisionsMode::Id`]. The [`ListRevisionsMode::Id`] mode is useful to retrieve revisions
/// for a given file across moves or renames.
pub fn list_revisions<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a ListRevisionsArg,
Expand Down Expand Up @@ -1326,23 +1322,20 @@ pub fn upload_session_finish_batch_check<'a>(
/// [`UploadSessionStartResult::session_id`](UploadSessionStartResult) with
/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) or
/// [`upload_session_finish()`](crate::files::upload_session_finish) more than 7 days after its
/// creation will return a
/// [`UploadSessionLookupError::NotFound`](UploadSessionLookupError::NotFound). Calls to this
/// endpoint will count as data transport calls for any Dropbox Business teams with a limit on the
/// number of data transport calls allowed per month. For more information, see the [Data transport
/// limit page](https://www.dropbox.com/developers/reference/data-transport-limit). By default,
/// upload sessions require you to send content of the file in sequential order via consecutive
/// creation will return a [`UploadSessionLookupError::NotFound`]. Calls to this endpoint will count
/// as data transport calls for any Dropbox Business teams with a limit on the number of data
/// transport calls allowed per month. For more information, see the [Data transport limit
/// page](https://www.dropbox.com/developers/reference/data-transport-limit). By default, upload
/// sessions require you to send content of the file in sequential order via consecutive
/// [`upload_session_start()`](crate::files::upload_session_start),
/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2),
/// [`upload_session_finish()`](crate::files::upload_session_finish) calls. For better performance,
/// you can instead optionally use a
/// [`UploadSessionType::Concurrent`](UploadSessionType::Concurrent) upload session. To start a new
/// concurrent session, set [`UploadSessionStartArg::session_type`](UploadSessionStartArg) to
/// [`UploadSessionType::Concurrent`](UploadSessionType::Concurrent). After that, you can send file
/// data in concurrent [`upload_session_append_v2()`](crate::files::upload_session_append_v2)
/// requests. Finally finish the session with
/// [`upload_session_finish()`](crate::files::upload_session_finish). There are couple of
/// constraints with concurrent sessions to make them work. You can not send data with
/// you can instead optionally use a [`UploadSessionType::Concurrent`] upload session. To start a
/// new concurrent session, set [`UploadSessionStartArg::session_type`](UploadSessionStartArg) to
/// [`UploadSessionType::Concurrent`]. After that, you can send file data in concurrent
/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) requests. Finally finish
/// the session with [`upload_session_finish()`](crate::files::upload_session_finish). There are
/// couple of constraints with concurrent sessions to make them work. You can not send data with
/// [`upload_session_start()`](crate::files::upload_session_start) or
/// [`upload_session_finish()`](crate::files::upload_session_finish) call, only with
/// [`upload_session_append_v2()`](crate::files::upload_session_append_v2) call. Also data uploaded
Expand Down
29 changes: 13 additions & 16 deletions src/generated/async_routes/sharing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ pub fn create_shared_link<'a>(
}

/// Create a shared link with custom settings. If no settings are given then the default visibility
/// is [`RequestedVisibility::Public`](RequestedVisibility::Public) (The resolved visibility,
/// though, may depend on other aspects such as team and shared folder settings).
/// is [`RequestedVisibility::Public`] (The resolved visibility, though, may depend on other aspects
/// such as team and shared folder settings).
pub fn create_shared_link_with_settings<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a CreateSharedLinkWithSettingsArg,
Expand Down Expand Up @@ -206,11 +206,10 @@ pub fn get_shared_link_metadata_app_auth<'a>(
None)
}

/// Returns a list of [`LinkMetadata`](LinkMetadata) objects for this user, including collection
/// links. If no path is given, returns a list of all shared links for the current user, including
/// collection links, up to a maximum of 1000 links. If a non-empty path is given, returns a list of
/// all shared links that allow access to the given path. Collection links are never returned in
/// this case.
/// Returns a list of [`LinkMetadata`] objects for this user, including collection links. If no path
/// is given, returns a list of all shared links for the current user, including collection links,
/// up to a maximum of 1000 links. If a non-empty path is given, returns a list of all shared links
/// that allow access to the given path. Collection links are never returned in this case.
#[deprecated(note = "replaced by list_shared_links")]
pub fn get_shared_links<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
Expand Down Expand Up @@ -420,8 +419,8 @@ pub fn list_shared_links<'a>(
/// Modify the shared link's settings. If the requested visibility conflict with the shared links
/// policy of the team or the shared folder (in case the linked file is part of a shared folder)
/// then the [`LinkPermissions::resolved_visibility`](LinkPermissions) of the returned
/// [`SharedLinkMetadata`](SharedLinkMetadata) will reflect the actual visibility of the shared link
/// and the [`LinkPermissions::requested_visibility`](LinkPermissions) will reflect the requested
/// [`SharedLinkMetadata`] will reflect the actual visibility of the shared link and the
/// [`LinkPermissions::requested_visibility`](LinkPermissions) will reflect the requested
/// visibility.
pub fn modify_shared_link_settings<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
Expand Down Expand Up @@ -546,8 +545,7 @@ pub fn revoke_shared_link<'a>(
}

/// Change the inheritance policy of an existing Shared Folder. Only permitted for shared folders in
/// a shared team root. If a [`ShareFolderLaunch::AsyncJobId`](ShareFolderLaunch::AsyncJobId) is
/// returned, you'll need to call
/// a shared team root. If a [`ShareFolderLaunch::AsyncJobId`] is returned, you'll need to call
/// [`check_share_job_status()`](crate::sharing::check_share_job_status) until the action completes
/// to get the metadata for the folder.
pub fn set_access_inheritance<'a>(
Expand All @@ -565,8 +563,7 @@ pub fn set_access_inheritance<'a>(

/// Share a folder with collaborators. Most sharing will be completed synchronously. Large folders
/// will be completed asynchronously. To make testing the async case repeatable, set
/// `ShareFolderArg.force_async`. If a
/// [`ShareFolderLaunch::AsyncJobId`](ShareFolderLaunch::AsyncJobId) is returned, you'll need to
/// `ShareFolderArg.force_async`. If a [`ShareFolderLaunch::AsyncJobId`] is returned, you'll need to
/// call [`check_share_job_status()`](crate::sharing::check_share_job_status) until the action
/// completes to get the metadata for the folder.
pub fn share_folder<'a>(
Expand All @@ -583,7 +580,7 @@ pub fn share_folder<'a>(
}

/// Transfer ownership of a shared folder to a member of the shared folder. User must have
/// [`AccessLevel::Owner`](AccessLevel::Owner) access to the shared folder to perform a transfer.
/// [`AccessLevel::Owner`] access to the shared folder to perform a transfer.
pub fn transfer_folder<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a TransferFolderArg,
Expand Down Expand Up @@ -670,8 +667,8 @@ pub fn update_folder_member<'a>(
None)
}

/// Update the sharing policies for a shared folder. User must have
/// [`AccessLevel::Owner`](AccessLevel::Owner) access to the shared folder to update its policies.
/// Update the sharing policies for a shared folder. User must have [`AccessLevel::Owner`] access to
/// the shared folder to update its policies.
pub fn update_folder_policy<'a>(
client: &'a impl crate::async_client_trait::UserAuthClient,
arg: &'a UpdateFolderPolicyArg,
Expand Down
Loading

0 comments on commit d909b84

Please sign in to comment.