Skip to content

Commit

Permalink
Improves documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesús Burgos committed Jul 14, 2018
1 parent 9847441 commit 685d226
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 40 deletions.
6 changes: 3 additions & 3 deletions lib/dropbox_api/endpoints/files/delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class Delete < DropboxApi::Endpoints::Rpc
# item at time of deletion, and not a {DropboxApi::Metadata::Deleted} object.
#
# @param path [String] Path in the user's Dropbox to delete.
# @option parent_rev [String] Perform delete if given "rev" matches the
# existing file's latest "rev". This field does not support deleting a
# folder. If the given "rev" doesn't match, a
# @option options parent_rev [String] Perform delete if given "rev"
# matches the existing file's latest "rev". This field does not support
# deleting a folder. If the given "rev" doesn't match, a
# {DropboxApi::Errors::FileConflictError} will be raised.
add_endpoint :delete do |path, options = {}|
validate_options([:parent_rev], options)
Expand Down
10 changes: 6 additions & 4 deletions lib/dropbox_api/endpoints/files/get_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ class GetMetadata < DropboxApi::Endpoints::Rpc
# `:pending` or `nil`.
#
# @param path [String] The path of a file or folder on Dropbox.
# @option include_media_info [Boolean] If `true`, FileMetadata.media_info
# @option options include_media_info [Boolean] If `true`, `media_info`
# is set for photo and video. The default for this field is `false`.
# @option include_deleted [Boolean] If `true`, DeletedMetadata will be
# returned for deleted file or folder, otherwise LookupError.not_found
# will be returned. The default for this field is False.
# @option options include_deleted [Boolean] If `true`,
# {DropboxApi::Metadata::Deleted} will be
# returned for deleted file or folder, otherwise
# {DropboxApi::Errors::NotFoundError}
# will be raised. The default for this field is `false`.
add_endpoint :get_metadata do |path, options = {}|
validate_options([:include_media_info, :include_deleted], options)

Expand Down
17 changes: 10 additions & 7 deletions lib/dropbox_api/endpoints/files/list_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ class ListFolder < DropboxApi::Endpoints::Rpc
# Returns the contents of a folder.
#
# @param path [String] The path to the folder you want to read.
# @option recursive [Boolean] If `true`, the list folder operation will be
# applied recursively to all subfolders and the response will contain
# contents of all subfolders. The default for this field is `false`.
# @option include_media_info [Boolean] If `true`, FileMetadata.media_info
# @option options recursive [Boolean] If `true`, the list folder operation
# will be applied recursively to all subfolders and the response will
# contain contents of all subfolders. The default for this field is
# `false`.
# @option options include_media_info [Boolean] If `true`, media_info
# is set for photo and video. The default for this field is `false`.
# @option include_deleted [Boolean] If `true`, DeletedMetadata will be
# returned for deleted file or folder, otherwise LookupError.not_found
# will be returned. The default for this field is `false`.
# @option options include_deleted [Boolean] If `true`,
# {DropboxApi::Metadata::Deleted} will be
# returned for deleted file or folder, otherwise
# {DropboxApi::Errors::NotFoundError}
# will be raised. The default for this field is `false`.
add_endpoint :list_folder do |path, options = {}|
validate_options([
:recursive,
Expand Down
4 changes: 2 additions & 2 deletions lib/dropbox_api/endpoints/files/list_revisions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class ListRevisions < DropboxApi::Endpoints::Rpc
# Return revisions of a file
#
# @param path [String] The path to file you want to see the revisions of.
# @option limit [Numeric] The maximum number of revision entries returned.
# The default for this field is 10.
# @option options limit [Numeric] The maximum number of revision entries
# returned. The default for this field is 10.
add_endpoint :list_revisions do |path, options = {}|
validate_options([
:limit
Expand Down
5 changes: 3 additions & 2 deletions lib/dropbox_api/endpoints/files/permanently_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class PermanentlyDelete < DropboxApi::Endpoints::Rpc
# Note: This endpoint is only available for Dropbox Business apps.
#
# @param path [String] Path in the user's Dropbox to delete.
# @option parent_rev [String] Perform delete if given "rev" matches the
# existing file's latest "rev". This field does not support deleting a folder.
# @option options parent_rev [String] Perform delete if given "rev"
# matches the existing file's latest "rev". This field does not support
# deleting a folder.
add_endpoint :permanently_delete do |path, options = {}|
validate_options([:parent_rev], options)

Expand Down
14 changes: 7 additions & 7 deletions lib/dropbox_api/endpoints/files/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class Search < DropboxApi::Endpoints::Rpc
# token is used for prefix matching (i.e. "bat c" matches "bat cave" but
# not "batman car").
# @param path [String] The path in the user's Dropbox to search.
# @option start [Numeric] The starting index within the search results
# (used for paging). The default for this field is 0.
# @option max_results [Numeric] The maximum number of search results to
# return. The default for this field is 100.
# @option mode [:filename, :filename_and_content, :deleted_filename] The
# search mode. Note that searching file content is only available for
# Dropbox Business accounts. The default is filename.
# @option options start [Numeric] The starting index within the search
# results (used for paging). The default for this field is 0.
# @option options max_results [Numeric] The maximum number of search
# results to return. The default for this field is 100.
# @option options mode [:filename, :filename_and_content, :deleted_filename]
# The search mode. Note that searching file content is only
# available for Dropbox Business accounts. The default is filename.
add_endpoint :search do |query, path = "", options = {}|
validate_options([
:start,
Expand Down
6 changes: 3 additions & 3 deletions lib/dropbox_api/endpoints/sharing/list_shared_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class ListSharedLinks < DropboxApi::Endpoints::Rpc
# links to parent folders of the given path. Links to parent folders can
# be suppressed by setting direct_only to true.
#
# @option path [String]
# @option cursor [String] The cursor returned by your last call.
# @option direct_only [Boolean]
# @option options path [String]
# @option options cursor [String] The cursor returned by your last call.
# @option options direct_only [Boolean]
# @return [ListSharedLinksResult]
add_endpoint :list_shared_links do |options = {}|
validate_options([:path, :cursor, :direct_only], options)
Expand Down
24 changes: 12 additions & 12 deletions lib/dropbox_api/endpoints/sharing/share_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ShareFolder < DropboxApi::Endpoints::Rpc
#
# Most sharing will be completed synchronously. Large folders will be
# completed asynchronously. To make testing the async case repeatable, set
# `ShareFolderArg.force_async`.
# `force_async`.
#
# If a ShareFolderLaunch.async_job_id is returned, you'll need to call
# check_share_job_status until the action completes to get the metadata
Expand All @@ -21,18 +21,18 @@ class ShareFolder < DropboxApi::Endpoints::Rpc
#
# @param path [String] The path to the folder to share. If it does not
# exist, then a new one is created.
# @option member_policy [:anyone, :team] Who can be a member of this shared
# folder. Only applicable if the current user is on a team. The default
# is `:anyone`.
# @option acl_update_policy [:owner, :editors] Who can add and remove
# members of this shared folder. The default is `:owner`.
# @option shared_link_policy [:anyone, :members] The policy to apply to
# shared links created for content inside this shared folder. The
# current user must be on a team to set this policy to `:members`.
# @option options member_policy [:anyone, :team] Who can be a member of
# this shared folder. Only applicable if the current user is on a team.
# The default is `:anyone`.
# @option options acl_update_policy [:owner, :editors] Who can add and
# remove members of this shared folder. The default is `:owner`.
# @option options shared_link_policy [:anyone, :members] The policy to
# apply to shared links created for content inside this shared folder.
# The current user must be on a team to set this policy to `:members`.
# The default is `anyone`.
# @option force_async [Boolean] Whether to force the share to happen
# asynchronously. The default for this field is `false`.
# @return [ShareFolderLaunch] Shared folder metadata.
# @option options force_async [Boolean] Whether to force the share to
# happen asynchronously. The default for this field is `false`.
# @return [DropboxApi::Results::ShareFolderLaunch] Shared folder metadata.
add_endpoint :share_folder do |path, options = {}|
validate_options([
:member_policy,
Expand Down

0 comments on commit 685d226

Please sign in to comment.