diff --git a/dropbox/auth.py b/dropbox/auth.py index 371a710e..5a558a13 100644 --- a/dropbox/auth.py +++ b/dropbox/auth.py @@ -357,7 +357,7 @@ def retry_after(self): The number of seconds that the app should wait before making another request. - :rtype: long + :rtype: int """ if self._retry_after_present: return self._retry_after_value diff --git a/dropbox/base.py b/dropbox/base.py index d79197de..9fe3655a 100644 --- a/dropbox/base.py +++ b/dropbox/base.py @@ -445,7 +445,7 @@ def file_requests_create(self, uploaded files will be sent. For apps with the app folder permission, this will be relative to the app folder. :param Nullable deadline: The deadline for the file request. Deadlines - can only be set by Pro and Business accounts. + can only be set by Professional and Business accounts. :param bool open: Whether or not the file request should be open. If the file request is closed, it will not accept any file submissions, but it can be opened later. @@ -516,7 +516,8 @@ def file_requests_update(self, :param Nullable destination: The new path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder permission, this will be relative to the app folder. - :param deadline: The new deadline for the file request. + :param deadline: The new deadline for the file request. Deadlines can + only be set by Professional and Business accounts. :type deadline: :class:`dropbox.file_requests.UpdateFileRequestDeadline` :param Nullable open: Whether to set this file request as open or closed. @@ -697,10 +698,38 @@ def files_copy(self, ) return r + def files_copy_batch_v2(self, + entries, + autorename=False): + """ + Copy multiple files or folders to different locations at once in the + user's Dropbox. This route will replace :meth:`files_copy_batch`. The + main difference is this route will return stutus for each entry, while + :meth:`files_copy_batch` raises failure if any entry fails. This route + will either finish synchronously, or return a job ID and do the async + copy job in background. Please use :meth:`files_copy_batch_check_v2` to + check the job status. + + :param list entries: List of entries to be moved or copied. Each entry + is :class:`dropbox.files.RelocationPath`. + :param bool autorename: If there's a conflict with any file, have the + Dropbox server try to autorename that file to avoid the conflict. + :rtype: :class:`dropbox.files.RelocationBatchV2Launch` + """ + arg = files.RelocationBatchArgBase(entries, + autorename) + r = self.request( + files.copy_batch_v2, + 'files', + arg, + None, + ) + return r + def files_copy_batch(self, entries, - allow_shared_folder=False, autorename=False, + allow_shared_folder=False, allow_ownership_transfer=False): """ Copy multiple files or folders to different locations at once in the @@ -712,23 +741,23 @@ def files_copy_batch(self, do the async copy job in background. Please use :meth:`files_copy_batch_check` to check the job status. - :param list entries: List of entries to be moved or copied. Each entry - is :class:`dropbox.files.RelocationPath`. :param bool allow_shared_folder: If true, :meth:`files_copy_batch` will copy contents in shared folder, otherwise ``RelocationError.cant_copy_shared_folder`` will be returned if - ``RelocationPath.from_path`` contains shared folder. This field is + ``RelocationPath.from_path`` contains shared folder. This field is always true for :meth:`files_move_batch`. - :param bool autorename: If there's a conflict with any file, have the - Dropbox server try to autorename that file to avoid the conflict. :param bool allow_ownership_transfer: Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies. :rtype: :class:`dropbox.files.RelocationBatchLaunch` """ + warnings.warn( + 'copy_batch is deprecated. Use copy_batch.', + DeprecationWarning, + ) arg = files.RelocationBatchArg(entries, - allow_shared_folder, autorename, + allow_shared_folder, allow_ownership_transfer) r = self.request( files.copy_batch, @@ -738,6 +767,29 @@ def files_copy_batch(self, ) return r + def files_copy_batch_check_v2(self, + async_job_id): + """ + Returns the status of an asynchronous job for + :meth:`files_copy_batch_v2`. It returns list of results for each entry. + + :param str async_job_id: Id of the asynchronous job. This is the value + of a response returned from the method that launched the job. + :rtype: :class:`dropbox.files.RelocationBatchV2JobStatus` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.files.PollError` + """ + arg = async_.PollArg(async_job_id) + r = self.request( + files.copy_batch_check_v2, + 'files', + arg, + None, + ) + return r + def files_copy_batch_check(self, async_job_id): """ @@ -752,6 +804,10 @@ def files_copy_batch_check(self, If this raises, ApiError will contain: :class:`dropbox.files.PollError` """ + warnings.warn( + 'copy_batch/check is deprecated. Use copy_batch/check.', + DeprecationWarning, + ) arg = async_.PollArg(async_job_id) r = self.request( files.copy_batch_check, @@ -1634,7 +1690,7 @@ def files_list_folder_longpoll(self, :param str cursor: A cursor as returned by :meth:`files_list_folder` or :meth:`files_list_folder_continue`. Cursors retrieved by setting ``ListFolderArg.include_media_info`` to ``True`` are not supported. - :param long timeout: A timeout in seconds. The request will block for at + :param int timeout: A timeout in seconds. The request will block for at most this length of time, plus up to 90 seconds of random jitter added to avoid the thundering herd problem. Care should be taken when using this parameter, as some network infrastructure does not @@ -1674,7 +1730,7 @@ def files_list_revisions(self, :param mode: Determines the behavior of the API in listing the revisions for a given file path or id. :type mode: :class:`dropbox.files.ListRevisionsMode` - :param long limit: The maximum number of revision entries returned. + :param int limit: The maximum number of revision entries returned. :rtype: :class:`dropbox.files.ListRevisionsResult` :raises: :class:`.exceptions.ApiError` @@ -1774,10 +1830,39 @@ def files_move(self, ) return r + def files_move_batch_v2(self, + entries, + autorename=False, + allow_ownership_transfer=False): + """ + Move multiple files or folders to different locations at once in the + user's Dropbox. This route will replace :meth:`files_move_batch_v2`. The + main difference is this route will return stutus for each entry, while + :meth:`files_move_batch` raises failure if any entry fails. This route + will either finish synchronously, or return a job ID and do the async + move job in background. Please use :meth:`files_move_batch_check_v2` to + check the job status. + + :param bool allow_ownership_transfer: Allow moves by owner even if it + would result in an ownership transfer for the content being moved. + This does not apply to copies. + :rtype: :class:`dropbox.files.RelocationBatchV2Launch` + """ + arg = files.MoveBatchArg(entries, + autorename, + allow_ownership_transfer) + r = self.request( + files.move_batch_v2, + 'files', + arg, + None, + ) + return r + def files_move_batch(self, entries, - allow_shared_folder=False, autorename=False, + allow_shared_folder=False, allow_ownership_transfer=False): """ Move multiple files or folders to different locations at once in the @@ -1786,23 +1871,19 @@ def files_move_batch(self, immediately and do the async moving job in background. Please use :meth:`files_move_batch_check` to check the job status. - :param list entries: List of entries to be moved or copied. Each entry - is :class:`dropbox.files.RelocationPath`. :param bool allow_shared_folder: If true, :meth:`files_copy_batch` will copy contents in shared folder, otherwise ``RelocationError.cant_copy_shared_folder`` will be returned if - ``RelocationPath.from_path`` contains shared folder. This field is + ``RelocationPath.from_path`` contains shared folder. This field is always true for :meth:`files_move_batch`. - :param bool autorename: If there's a conflict with any file, have the - Dropbox server try to autorename that file to avoid the conflict. :param bool allow_ownership_transfer: Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies. :rtype: :class:`dropbox.files.RelocationBatchLaunch` """ arg = files.RelocationBatchArg(entries, - allow_shared_folder, autorename, + allow_shared_folder, allow_ownership_transfer) r = self.request( files.move_batch, @@ -1812,6 +1893,29 @@ def files_move_batch(self, ) return r + def files_move_batch_check_v2(self, + async_job_id): + """ + Returns the status of an asynchronous job for + :meth:`files_move_batch_v2`. It returns list of results for each entry. + + :param str async_job_id: Id of the asynchronous job. This is the value + of a response returned from the method that launched the job. + :rtype: :class:`dropbox.files.RelocationBatchV2JobStatus` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.files.PollError` + """ + arg = async_.PollArg(async_job_id) + r = self.request( + files.move_batch_check_v2, + 'files', + arg, + None, + ) + return r + def files_move_batch_check(self, async_job_id): """ @@ -2039,9 +2143,11 @@ def files_save_url(self, path, url): """ - Save a specified URL into a file in user's Dropbox. If the given path - already exists, the file will be renamed to avoid the conflict (e.g. - myfile (1).txt). + Save the data from a specified URL into a file in user's Dropbox. Note + that the transfer from the URL must complete within 5 minutes, or the + operation will time out and the job will fail. If the given path already + exists, the file will be renamed to avoid the conflict (e.g. myfile + (1).txt). :param str path: The path in Dropbox where the URL will be saved to. :param str url: The URL to be saved. @@ -2099,9 +2205,9 @@ def files_search(self, on spaces into multiple tokens. For file name searching, the last token is used for prefix matching (i.e. "bat c" matches "bat cave" but not "batman car"). - :param long start: The starting index within the search results (used - for paging). - :param long max_results: The maximum number of search results to return. + :param int start: The starting index within the search results (used for + paging). + :param int max_results: The maximum number of search results to return. :param mode: The search mode (filename, filename_and_content, or deleted_filename). Note that searching file content is only available for Dropbox Business accounts. @@ -2241,7 +2347,7 @@ def files_upload_session_append(self, :param bytes f: Contents to upload. :param str session_id: The upload session ID (returned by :meth:`files_upload_session_start`). - :param long offset: The amount of data that has been uploaded so far. We + :param int offset: The amount of data that has been uploaded so far. We use this to make sure upload data isn't lost or duplicated in the event of a network error. :rtype: None @@ -2733,7 +2839,7 @@ def paper_docs_update(self, :param bytes f: Contents to upload. :param doc_update_policy: The policy used for the current update call. :type doc_update_policy: :class:`dropbox.paper.PaperDocUpdatePolicy` - :param long revision: The latest doc revision. This value must match the + :param int revision: The latest doc revision. This value must match the head revision or an error code will be returned. This is to prevent colliding writes. :param import_format: The format of provided data. @@ -2931,8 +3037,7 @@ def sharing_add_folder_member(self, Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another member. For the new member to get access to all the functionality for this folder, you will need to call - :meth:`sharing_mount_folder` on their behalf. Apps must have full - Dropbox access to use this endpoint. + :meth:`sharing_mount_folder` on their behalf. :param str shared_folder_id: The ID for the shared folder. :param list members: The intended list of members to add. Added members @@ -2995,8 +3100,7 @@ def sharing_change_file_member_access(self, def sharing_check_job_status(self, async_job_id): """ - Returns the status of an asynchronous job. Apps must have full Dropbox - access to use this endpoint. + Returns the status of an asynchronous job. :param str async_job_id: Id of the asynchronous job. This is the value of a response returned from the method that launched the job. @@ -3018,8 +3122,7 @@ def sharing_check_job_status(self, def sharing_check_remove_member_job_status(self, async_job_id): """ - Returns the status of an asynchronous job for sharing a folder. Apps - must have full Dropbox access to use this endpoint. + Returns the status of an asynchronous job for sharing a folder. :param str async_job_id: Id of the asynchronous job. This is the value of a response returned from the method that launched the job. @@ -3041,8 +3144,7 @@ def sharing_check_remove_member_job_status(self, def sharing_check_share_job_status(self, async_job_id): """ - Returns the status of an asynchronous job for sharing a folder. Apps - must have full Dropbox access to use this endpoint. + Returns the status of an asynchronous job for sharing a folder. :param str async_job_id: Id of the asynchronous job. This is the value of a response returned from the method that launched the job. @@ -3189,8 +3291,7 @@ def sharing_get_folder_metadata(self, shared_folder_id, actions=None): """ - Returns shared folder metadata by its folder ID. Apps must have full - Dropbox access to use this endpoint. + Returns shared folder metadata by its folder ID. :param str shared_folder_id: The ID for the shared folder. :param Nullable actions: A list of `FolderAction`s corresponding to @@ -3358,8 +3459,8 @@ def sharing_list_file_members(self, a member. :param bool include_inherited: Whether to include members who only have access from a parent shared folder. - :param long limit: Number of members to return max per query. Defaults - to 100 if no limit is specified. + :param int limit: Number of members to return max per query. Defaults to + 100 if no limit is specified. :rtype: :class:`dropbox.sharing.SharedFileMembers` :raises: :class:`.exceptions.ApiError` @@ -3389,8 +3490,8 @@ def sharing_list_file_members_batch(self, permissions are not returned for this endpoint. :param list files: Files for which to return members. - :param long limit: Number of members to return max per query. Defaults - to 10 if no limit is specified. + :param int limit: Number of members to return max per query. Defaults to + 10 if no limit is specified. :rtype: list :raises: :class:`.exceptions.ApiError` @@ -3438,8 +3539,7 @@ def sharing_list_folder_members(self, actions=None, limit=1000): """ - Returns shared folder membership by its folder ID. Apps must have full - Dropbox access to use this endpoint. + Returns shared folder membership by its folder ID. :param str shared_folder_id: The ID for the shared folder. :rtype: :class:`dropbox.sharing.SharedFolderMembers` @@ -3464,8 +3564,7 @@ def sharing_list_folder_members_continue(self, """ Once a cursor has been retrieved from :meth:`sharing_list_folder_members`, use this to paginate through all - shared folder members. Apps must have full Dropbox access to use this - endpoint. + shared folder members. :param str cursor: The cursor returned by your last call to :meth:`sharing_list_folder_members` or @@ -3490,9 +3589,8 @@ def sharing_list_folders(self, actions=None): """ Return the list of all shared folders the current user has access to. - Apps must have full Dropbox access to use this endpoint. - :param long limit: The maximum number of results to return per request. + :param int limit: The maximum number of results to return per request. :param Nullable actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's ``SharedFolderMetadata.permissions`` field describing the actions @@ -3515,8 +3613,7 @@ def sharing_list_folders_continue(self, Once a cursor has been retrieved from :meth:`sharing_list_folders`, use this to paginate through all shared folders. The cursor must come from a previous call to :meth:`sharing_list_folders` or - :meth:`sharing_list_folders_continue`. Apps must have full Dropbox - access to use this endpoint. + :meth:`sharing_list_folders_continue`. :param str cursor: The cursor returned by the previous API call specified in the endpoint description. @@ -3540,9 +3637,9 @@ def sharing_list_mountable_folders(self, actions=None): """ Return the list of all shared folders the current user can mount or - unmount. Apps must have full Dropbox access to use this endpoint. + unmount. - :param long limit: The maximum number of results to return per request. + :param int limit: The maximum number of results to return per request. :param Nullable actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's ``SharedFolderMetadata.permissions`` field describing the actions @@ -3566,8 +3663,7 @@ def sharing_list_mountable_folders_continue(self, :meth:`sharing_list_mountable_folders`, use this to paginate through all mountable shared folders. The cursor must come from a previous call to :meth:`sharing_list_mountable_folders` or - :meth:`sharing_list_mountable_folders_continue`. Apps must have full - Dropbox access to use this endpoint. + :meth:`sharing_list_mountable_folders_continue`. :param str cursor: The cursor returned by the previous API call specified in the endpoint description. @@ -3594,7 +3690,7 @@ def sharing_list_received_files(self, files the user has received via shared folders, and does not include unclaimed invitations. - :param long limit: Number of files to return max per query. Defaults to + :param int limit: Number of files to return max per query. Defaults to 100 if no limit is specified. :param Nullable actions: A list of `FileAction`s corresponding to `FilePermission`s that should appear in the response's @@ -3712,8 +3808,7 @@ def sharing_mount_folder(self, """ The current user mounts the designated folder. Mount a shared folder for a user after they have been added as a member. Once mounted, the shared - folder will appear in their Dropbox. Apps must have full Dropbox access - to use this endpoint. + folder will appear in their Dropbox. :param str shared_folder_id: The ID of the shared folder to mount. :rtype: :class:`dropbox.sharing.SharedFolderMetadata` @@ -3736,8 +3831,7 @@ def sharing_relinquish_file_membership(self, """ The current user relinquishes their membership in the designated file. Note that the current user may still have inherited access to this file - through the parent folder. Apps must have full Dropbox access to use - this endpoint. + through the parent folder. :param str file: The path or id for the file. :rtype: None @@ -3763,8 +3857,7 @@ def sharing_relinquish_folder_membership(self, folder and will no longer have access to the folder. A folder owner cannot relinquish membership in their own folder. This will run synchronously if leave_a_copy is false, and asynchronously if - leave_a_copy is true. Apps must have full Dropbox access to use this - endpoint. + leave_a_copy is true. :param str shared_folder_id: The ID for the shared folder. :param bool leave_a_copy: Keep a copy of the folder's contents upon @@ -3851,8 +3944,7 @@ def sharing_remove_folder_member(self, leave_a_copy): """ Allows an owner or editor (if the ACL update policy allows) of a shared - folder to remove another member. Apps must have full Dropbox access to - use this endpoint. + folder to remove another member. :param str shared_folder_id: The ID for the shared folder. :param member: The member to remove from the folder. @@ -3950,8 +4042,7 @@ def sharing_share_folder(self, testing the async case repeatable, set `ShareFolderArg.force_async`. If a ``ShareFolderLaunch.async_job_id`` is returned, you'll need to call :meth:`sharing_check_share_job_status` until the action completes to get - the metadata for the folder. Apps must have full Dropbox access to use - this endpoint. + the metadata for the folder. :param Nullable actions: A list of `FolderAction`s corresponding to `FolderPermission`s that should appear in the response's @@ -3987,8 +4078,7 @@ def sharing_transfer_folder(self, """ Transfer ownership of a shared folder to a member of the shared folder. User must have ``AccessLevel.owner`` access to the shared folder to - perform a transfer. Apps must have full Dropbox access to use this - endpoint. + perform a transfer. :param str shared_folder_id: The ID for the shared folder. :param str to_dropbox_id: A account or team member ID to transfer @@ -4013,8 +4103,7 @@ def sharing_unmount_folder(self, shared_folder_id): """ The current user unmounts the designated folder. They can re-mount the - folder at a later time using :meth:`sharing_mount_folder`. Apps must - have full Dropbox access to use this endpoint. + folder at a later time using :meth:`sharing_mount_folder`. :param str shared_folder_id: The ID for the shared folder. :rtype: None @@ -4059,8 +4148,7 @@ def sharing_unshare_folder(self, """ Allows a shared folder owner to unshare the folder. You'll need to call :meth:`sharing_check_job_status` to determine if the action has - completed successfully. Apps must have full Dropbox access to use this - endpoint. + completed successfully. :param str shared_folder_id: The ID for the shared folder. :param bool leave_a_copy: If true, members of this shared folder will @@ -4113,7 +4201,7 @@ def sharing_update_folder_member(self, access_level): """ Allows an owner or editor of a shared folder to update another member's - permissions. Apps must have full Dropbox access to use this endpoint. + permissions. :param str shared_folder_id: The ID for the shared folder. :param member: The member of the shared folder to update. Only the @@ -4150,7 +4238,7 @@ def sharing_update_folder_policy(self, """ Update the sharing policies for a shared folder. User must have ``AccessLevel.owner`` access to the shared folder to update its - policies. Apps must have full Dropbox access to use this endpoint. + policies. :param str shared_folder_id: The ID for the shared folder. :param Nullable member_policy: Who can be a member of this shared diff --git a/dropbox/base_team.py b/dropbox/base_team.py index 60ae2351..cb01060d 100644 --- a/dropbox/base_team.py +++ b/dropbox/base_team.py @@ -229,7 +229,8 @@ def team_devices_list_members_devices(self, include_desktop_clients=True, include_mobile_clients=True): """ - List all device sessions of a team. + List all device sessions of a team. Permission : Team member file + access. :param Nullable cursor: At the first call to the :meth:`team_devices_list_members_devices` the cursor shouldn't be @@ -266,7 +267,8 @@ def team_devices_list_team_devices(self, include_desktop_clients=True, include_mobile_clients=True): """ - List all device sessions of a team. + List all device sessions of a team. Permission : Team member file + access. :param Nullable cursor: At the first call to the :meth:`team_devices_list_team_devices` the cursor shouldn't be @@ -491,7 +493,7 @@ def team_groups_list(self, """ Lists groups on a team. Permission : Team Information. - :param long limit: Number of results to return per call. + :param int limit: Number of results to return per call. :rtype: :class:`dropbox.team.GroupsListResult` """ arg = team.GroupsListArg(limit) @@ -564,7 +566,7 @@ def team_groups_members_list(self, :param group: The group whose members are to be listed. :type group: :class:`dropbox.team.GroupSelector` - :param long limit: Number of results to return per call. + :param int limit: Number of results to return per call. :rtype: :class:`dropbox.team.GroupsMembersListResult` :raises: :class:`.exceptions.ApiError` @@ -863,7 +865,7 @@ def team_member_space_limits_excluded_users_list(self, """ List member space limits excluded users. - :param long limit: Number of results to return per call. + :param int limit: Number of results to return per call. :rtype: :class:`dropbox.team.ExcludedUsersListResult` :raises: :class:`.exceptions.ApiError` @@ -1073,7 +1075,7 @@ def team_members_list(self, """ Lists members of a team. Permission : Team information. - :param long limit: Number of results to return per call. + :param int limit: Number of results to return per call. :param bool include_removed: Whether to return removed members. :rtype: :class:`dropbox.team.MembersListResult` :raises: :class:`.exceptions.ApiError` @@ -1426,7 +1428,7 @@ def team_namespaces_list(self, folders may be owned by other users or other teams. Duplicates may occur in the list. - :param long limit: Specifying a value here has no effect. + :param int limit: Specifying a value here has no effect. :rtype: :class:`dropbox.team.TeamNamespacesListResult` :raises: :class:`.exceptions.ApiError` @@ -1470,6 +1472,15 @@ def team_properties_template_add(self, name, description, fields): + """ + Permission : Team member file access. + + :rtype: :class:`dropbox.team.AddTemplateResult` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.team.ModifyTemplateError` + """ warnings.warn( 'properties/template/add is deprecated.', DeprecationWarning, @@ -1488,6 +1499,8 @@ def team_properties_template_add(self, def team_properties_template_get(self, template_id): """ + Permission : Team member file access. + :param str template_id: An identifier for template added by route See :meth:`team_templates_add_for_user` or :meth:`team_templates_add_for_team`. @@ -1511,6 +1524,15 @@ def team_properties_template_get(self, return r def team_properties_template_list(self): + """ + Permission : Team member file access. + + :rtype: :class:`dropbox.team.ListTemplateResult` + :raises: :class:`.exceptions.ApiError` + + If this raises, ApiError will contain: + :class:`dropbox.team.TemplateError` + """ warnings.warn( 'properties/template/list is deprecated.', DeprecationWarning, @@ -1530,6 +1552,8 @@ def team_properties_template_update(self, description=None, add_fields=None): """ + Permission : Team member file access. + :param str template_id: An identifier for template added by See :meth:`team_templates_add_for_user` or :meth:`team_templates_add_for_team`. @@ -1769,7 +1793,7 @@ def team_team_folder_list(self, """ Lists all team folders. Permission : Team member file access. - :param long limit: The maximum number of results to return per request. + :param int limit: The maximum number of results to return per request. :rtype: :class:`dropbox.team.TeamFolderListResult` :raises: :class:`.exceptions.ApiError` @@ -1918,9 +1942,9 @@ def team_log_get_events(self, `_ to check for this feature. Permission : Team Auditing. - :param long limit: The maximal number of results to return per call. - Note that some calls may not return ``limit`` number of events, and - may even return no events, even with `has_more` set to true. In this + :param int limit: The maximal number of results to return per call. Note + that some calls may not return ``limit`` number of events, and may + even return no events, even with `has_more` set to true. In this case, callers should fetch again using :meth:`team_log_get_events_continue`. :param Nullable account_id: Filter the events by account ID. Return ony diff --git a/dropbox/common.py b/dropbox/common.py index cd68f7f1..e17c92de 100644 --- a/dropbox/common.py +++ b/dropbox/common.py @@ -382,7 +382,7 @@ def __repr__(self): DisplayName_validator = bv.String(min_length=1, pattern=u'[^/:?*<>"|]*') DisplayNameLegacy_validator = bv.String() DropboxTimestamp_validator = bv.Timestamp(u'%Y-%m-%dT%H:%M:%SZ') -EmailAddress_validator = bv.String(max_length=255, pattern=u"^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$") +EmailAddress_validator = bv.String(max_length=255, pattern=u"^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\\.[A-Za-z]{2,15}$") # A ISO639-1 code. LanguageCode_validator = bv.String(min_length=2) NamePart_validator = bv.String(min_length=1, max_length=100, pattern=u'[^/:?*<>"|]*') diff --git a/dropbox/file_requests.py b/dropbox/file_requests.py index 7ad74604..953467e1 100644 --- a/dropbox/file_requests.py +++ b/dropbox/file_requests.py @@ -34,7 +34,7 @@ class CreateFileRequestArgs(bb.Struct): files will be sent. For apps with the app folder permission, this will be relative to the app folder. :ivar deadline: The deadline for the file request. Deadlines can only be set - by Pro and Business accounts. + by Professional and Business accounts. :ivar open: Whether or not the file request should be open. If the file request is closed, it will not accept any file submissions, but it can be opened later. @@ -126,8 +126,8 @@ def destination(self): @property def deadline(self): """ - The deadline for the file request. Deadlines can only be set by Pro and - Business accounts. + The deadline for the file request. Deadlines can only be set by + Professional and Business accounts. :rtype: FileRequestDeadline """ @@ -625,7 +625,7 @@ def file_count(self): """ The number of files this file request has received. - :rtype: long + :rtype: int """ if self._file_count_present: return self._file_count_value @@ -979,7 +979,8 @@ class UpdateFileRequestArgs(bb.Struct): :ivar destination: The new path of the folder in the Dropbox where uploaded files will be sent. For apps with the app folder permission, this will be relative to the app folder. - :ivar deadline: The new deadline for the file request. + :ivar deadline: The new deadline for the file request. Deadlines can only be + set by Professional and Business accounts. :ivar open: Whether to set this file request as open or closed. """ @@ -1105,7 +1106,8 @@ def destination(self): @property def deadline(self): """ - The new deadline for the file request. + The new deadline for the file request. Deadlines can only be set by + Professional and Business accounts. :rtype: UpdateFileRequestDeadline """ diff --git a/dropbox/files.py b/dropbox/files.py index 308e2a6e..496dff06 100644 --- a/dropbox/files.py +++ b/dropbox/files.py @@ -1281,6 +1281,10 @@ def __repr__(self): FileOpsResult_validator = bv.Struct(FileOpsResult) class CreateFolderBatchResult(FileOpsResult): + """ + :ivar entries: Each entry in ``CreateFolderBatchArg.paths`` will appear at + the same position inside ``CreateFolderBatchResult.entries``. + """ __slots__ = [ '_entries_value', @@ -1300,6 +1304,9 @@ def __init__(self, @property def entries(self): """ + Each entry in ``CreateFolderBatchArg.paths`` will appear at the same + position inside ``CreateFolderBatchResult.entries``. + :rtype: list of [CreateFolderBatchResultEntry] """ if self._entries_present: @@ -1940,6 +1947,10 @@ def __repr__(self): DeleteBatchLaunch_validator = bv.Union(DeleteBatchLaunch) class DeleteBatchResult(FileOpsResult): + """ + :ivar entries: Each entry in ``DeleteBatchArg.entries`` will appear at the + same position inside ``DeleteBatchResult.entries``. + """ __slots__ = [ '_entries_value', @@ -1959,6 +1970,9 @@ def __init__(self, @property def entries(self): """ + Each entry in ``DeleteBatchArg.entries`` will appear at the same + position inside ``DeleteBatchResult.entries``. + :rtype: list of [DeleteBatchResultEntry] """ if self._entries_present: @@ -2524,7 +2538,7 @@ def height(self): """ Height of the photo/video. - :rtype: long + :rtype: int """ if self._height_present: return self._height_value @@ -2547,7 +2561,7 @@ def width(self): """ Width of the photo/video. - :rtype: long + :rtype: int """ if self._width_present: return self._width_value @@ -3124,7 +3138,7 @@ def size(self): """ The file size in bytes. - :rtype: long + :rtype: int """ if self._size_present: return self._size_value @@ -5042,7 +5056,7 @@ def limit(self): approximate number and there can be slightly more entries returned in some cases. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -5446,7 +5460,7 @@ def timeout(self): thundering herd problem. Care should be taken when using this parameter, as some network infrastructure does not support long timeouts. - :rtype: long + :rtype: int """ if self._timeout_present: return self._timeout_value @@ -5578,7 +5592,7 @@ def backoff(self): If present, backoff for at least this many seconds before calling :meth:`dropbox.dropbox.Dropbox.files_list_folder_longpoll` again. - :rtype: long + :rtype: int """ if self._backoff_present: return self._backoff_value @@ -5822,7 +5836,7 @@ def limit(self): """ The maximum number of revision entries returned. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -6387,6 +6401,155 @@ def __repr__(self): MediaMetadata_validator = bv.StructTree(MediaMetadata) +class RelocationBatchArgBase(bb.Struct): + """ + :ivar entries: List of entries to be moved or copied. Each entry is + :class:`RelocationPath`. + :ivar autorename: If there's a conflict with any file, have the Dropbox + server try to autorename that file to avoid the conflict. + """ + + __slots__ = [ + '_entries_value', + '_entries_present', + '_autorename_value', + '_autorename_present', + ] + + _has_required_fields = True + + def __init__(self, + entries=None, + autorename=None): + self._entries_value = None + self._entries_present = False + self._autorename_value = None + self._autorename_present = False + if entries is not None: + self.entries = entries + if autorename is not None: + self.autorename = autorename + + @property + def entries(self): + """ + List of entries to be moved or copied. Each entry is + :class:`RelocationPath`. + + :rtype: list of [RelocationPath] + """ + if self._entries_present: + return self._entries_value + else: + raise AttributeError("missing required field 'entries'") + + @entries.setter + def entries(self, val): + val = self._entries_validator.validate(val) + self._entries_value = val + self._entries_present = True + + @entries.deleter + def entries(self): + self._entries_value = None + self._entries_present = False + + @property + def autorename(self): + """ + If there's a conflict with any file, have the Dropbox server try to + autorename that file to avoid the conflict. + + :rtype: bool + """ + if self._autorename_present: + return self._autorename_value + else: + return False + + @autorename.setter + def autorename(self, val): + val = self._autorename_validator.validate(val) + self._autorename_value = val + self._autorename_present = True + + @autorename.deleter + def autorename(self): + self._autorename_value = None + self._autorename_present = False + + def _process_custom_annotations(self, annotation_type, processor): + super(RelocationBatchArgBase, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'RelocationBatchArgBase(entries={!r}, autorename={!r})'.format( + self._entries_value, + self._autorename_value, + ) + +RelocationBatchArgBase_validator = bv.Struct(RelocationBatchArgBase) + +class MoveBatchArg(RelocationBatchArgBase): + """ + :ivar allow_ownership_transfer: Allow moves by owner even if it would result + in an ownership transfer for the content being moved. This does not + apply to copies. + """ + + __slots__ = [ + '_allow_ownership_transfer_value', + '_allow_ownership_transfer_present', + ] + + _has_required_fields = True + + def __init__(self, + entries=None, + autorename=None, + allow_ownership_transfer=None): + super(MoveBatchArg, self).__init__(entries, + autorename) + self._allow_ownership_transfer_value = None + self._allow_ownership_transfer_present = False + if allow_ownership_transfer is not None: + self.allow_ownership_transfer = allow_ownership_transfer + + @property + def allow_ownership_transfer(self): + """ + Allow moves by owner even if it would result in an ownership transfer + for the content being moved. This does not apply to copies. + + :rtype: bool + """ + if self._allow_ownership_transfer_present: + return self._allow_ownership_transfer_value + else: + return False + + @allow_ownership_transfer.setter + def allow_ownership_transfer(self, val): + val = self._allow_ownership_transfer_validator.validate(val) + self._allow_ownership_transfer_value = val + self._allow_ownership_transfer_present = True + + @allow_ownership_transfer.deleter + def allow_ownership_transfer(self): + self._allow_ownership_transfer_value = None + self._allow_ownership_transfer_present = False + + def _process_custom_annotations(self, annotation_type, processor): + super(MoveBatchArg, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'MoveBatchArg(entries={!r}, autorename={!r}, allow_ownership_transfer={!r})'.format( + self._entries_value, + self._autorename_value, + self._allow_ownership_transfer_value, + ) + +MoveBatchArg_validator = bv.Struct(MoveBatchArg) + class PhotoMetadata(MediaMetadata): """ Metadata for a photo. @@ -6809,30 +6972,22 @@ def __repr__(self): RelocationArg_validator = bv.Struct(RelocationArg) -class RelocationBatchArg(bb.Struct): +class RelocationBatchArg(RelocationBatchArgBase): """ - :ivar entries: List of entries to be moved or copied. Each entry is - :class:`RelocationPath`. :ivar allow_shared_folder: If true, :meth:`dropbox.dropbox.Dropbox.files_copy_batch` will copy contents in shared folder, otherwise ``RelocationError.cant_copy_shared_folder`` will be returned if ``RelocationPath.from_path`` contains shared folder. This field is always true for :meth:`dropbox.dropbox.Dropbox.files_move_batch`. - :ivar autorename: If there's a conflict with any file, have the Dropbox - server try to autorename that file to avoid the conflict. :ivar allow_ownership_transfer: Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies. """ __slots__ = [ - '_entries_value', - '_entries_present', '_allow_shared_folder_value', '_allow_shared_folder_present', - '_autorename_value', - '_autorename_present', '_allow_ownership_transfer_value', '_allow_ownership_transfer_present', ] @@ -6841,57 +6996,27 @@ class RelocationBatchArg(bb.Struct): def __init__(self, entries=None, - allow_shared_folder=None, autorename=None, + allow_shared_folder=None, allow_ownership_transfer=None): - self._entries_value = None - self._entries_present = False + super(RelocationBatchArg, self).__init__(entries, + autorename) self._allow_shared_folder_value = None self._allow_shared_folder_present = False - self._autorename_value = None - self._autorename_present = False self._allow_ownership_transfer_value = None self._allow_ownership_transfer_present = False - if entries is not None: - self.entries = entries if allow_shared_folder is not None: self.allow_shared_folder = allow_shared_folder - if autorename is not None: - self.autorename = autorename if allow_ownership_transfer is not None: self.allow_ownership_transfer = allow_ownership_transfer - @property - def entries(self): - """ - List of entries to be moved or copied. Each entry is - :class:`RelocationPath`. - - :rtype: list of [RelocationPath] - """ - if self._entries_present: - return self._entries_value - else: - raise AttributeError("missing required field 'entries'") - - @entries.setter - def entries(self, val): - val = self._entries_validator.validate(val) - self._entries_value = val - self._entries_present = True - - @entries.deleter - def entries(self): - self._entries_value = None - self._entries_present = False - @property def allow_shared_folder(self): """ If true, :meth:`dropbox.dropbox.Dropbox.files_copy_batch` will copy contents in shared folder, otherwise ``RelocationError.cant_copy_shared_folder`` will be returned if - ``RelocationPath.from_path`` contains shared folder. This field is + ``RelocationPath.from_path`` contains shared folder. This field is always true for :meth:`dropbox.dropbox.Dropbox.files_move_batch`. :rtype: bool @@ -6912,30 +7037,6 @@ def allow_shared_folder(self): self._allow_shared_folder_value = None self._allow_shared_folder_present = False - @property - def autorename(self): - """ - If there's a conflict with any file, have the Dropbox server try to - autorename that file to avoid the conflict. - - :rtype: bool - """ - if self._autorename_present: - return self._autorename_value - else: - return False - - @autorename.setter - def autorename(self, val): - val = self._autorename_validator.validate(val) - self._autorename_value = val - self._autorename_present = True - - @autorename.deleter - def autorename(self): - self._autorename_value = None - self._autorename_present = False - @property def allow_ownership_transfer(self): """ @@ -6964,10 +7065,10 @@ def _process_custom_annotations(self, annotation_type, processor): super(RelocationBatchArg, self)._process_custom_annotations(annotation_type, processor) def __repr__(self): - return 'RelocationBatchArg(entries={!r}, allow_shared_folder={!r}, autorename={!r}, allow_ownership_transfer={!r})'.format( + return 'RelocationBatchArg(entries={!r}, autorename={!r}, allow_shared_folder={!r}, allow_ownership_transfer={!r})'.format( self._entries_value, - self._allow_shared_folder_value, self._autorename_value, + self._allow_shared_folder_value, self._allow_ownership_transfer_value, ) @@ -6992,6 +7093,9 @@ class RelocationError(bb.Union): ``RelocationArg.allow_ownership_transfer`` to true. :ivar insufficient_quota: The current user does not have enough space to move or copy the files. + :ivar internal_error: Something went wrong with the job on Dropbox's end. + You'll need to verify that the action you were taking succeeded, and if + not, try again. This should happen very rarely. """ _catch_all = 'other' @@ -7010,6 +7114,8 @@ class RelocationError(bb.Union): # Attribute is overwritten below the class definition insufficient_quota = None # Attribute is overwritten below the class definition + internal_error = None + # Attribute is overwritten below the class definition other = None @classmethod @@ -7125,6 +7231,14 @@ def is_insufficient_quota(self): """ return self._tag == 'insufficient_quota' + def is_internal_error(self): + """ + Check if the union tag is ``internal_error``. + + :rtype: bool + """ + return self._tag == 'internal_error' + def is_other(self): """ Check if the union tag is ``other``. @@ -7200,55 +7314,140 @@ def __repr__(self): RelocationBatchError_validator = bv.Union(RelocationBatchError) -class RelocationBatchJobStatus(async_.PollResultBase): +class RelocationBatchErrorEntry(bb.Union): """ This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. - :ivar RelocationBatchResult complete: The copy or move batch job has - finished. - :ivar RelocationBatchError failed: The copy or move batch job has failed - with exception. + :ivar RelocationError relocation_error: User errors that retry won't help. + :ivar internal_error: Something went wrong with the job on Dropbox's end. + You'll need to verify that the action you were taking succeeded, and if + not, try again. This should happen very rarely. + :ivar too_many_write_operations: There are too many write operations in + user's Dropbox. Please retry this request. """ + _catch_all = 'other' + # Attribute is overwritten below the class definition + internal_error = None + # Attribute is overwritten below the class definition + too_many_write_operations = None + # Attribute is overwritten below the class definition + other = None + @classmethod - def complete(cls, val): + def relocation_error(cls, val): """ - Create an instance of this class set to the ``complete`` tag with value - ``val``. + Create an instance of this class set to the ``relocation_error`` tag + with value ``val``. - :param RelocationBatchResult val: - :rtype: RelocationBatchJobStatus + :param RelocationError val: + :rtype: RelocationBatchErrorEntry """ - return cls('complete', val) + return cls('relocation_error', val) - @classmethod - def failed(cls, val): + def is_relocation_error(self): """ - Create an instance of this class set to the ``failed`` tag with value - ``val``. + Check if the union tag is ``relocation_error``. - :param RelocationBatchError val: - :rtype: RelocationBatchJobStatus + :rtype: bool """ - return cls('failed', val) + return self._tag == 'relocation_error' - def is_complete(self): + def is_internal_error(self): """ - Check if the union tag is ``complete``. + Check if the union tag is ``internal_error``. :rtype: bool """ - return self._tag == 'complete' + return self._tag == 'internal_error' - def is_failed(self): + def is_too_many_write_operations(self): """ - Check if the union tag is ``failed``. + Check if the union tag is ``too_many_write_operations``. :rtype: bool """ - return self._tag == 'failed' + return self._tag == 'too_many_write_operations' + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == 'other' + + def get_relocation_error(self): + """ + User errors that retry won't help. + + Only call this if :meth:`is_relocation_error` is true. + + :rtype: RelocationError + """ + if not self.is_relocation_error(): + raise AttributeError("tag 'relocation_error' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, processor): + super(RelocationBatchErrorEntry, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'RelocationBatchErrorEntry(%r, %r)' % (self._tag, self._value) + +RelocationBatchErrorEntry_validator = bv.Union(RelocationBatchErrorEntry) + +class RelocationBatchJobStatus(async_.PollResultBase): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar RelocationBatchResult complete: The copy or move batch job has + finished. + :ivar RelocationBatchError failed: The copy or move batch job has failed + with exception. + """ + + @classmethod + def complete(cls, val): + """ + Create an instance of this class set to the ``complete`` tag with value + ``val``. + + :param RelocationBatchResult val: + :rtype: RelocationBatchJobStatus + """ + return cls('complete', val) + + @classmethod + def failed(cls, val): + """ + Create an instance of this class set to the ``failed`` tag with value + ``val``. + + :param RelocationBatchError val: + :rtype: RelocationBatchJobStatus + """ + return cls('failed', val) + + def is_complete(self): + """ + Check if the union tag is ``complete``. + + :rtype: bool + """ + return self._tag == 'complete' + + def is_failed(self): + """ + Check if the union tag is ``failed``. + + :rtype: bool + """ + return self._tag == 'failed' def get_complete(self): """ @@ -7442,6 +7641,248 @@ def __repr__(self): RelocationBatchResultData_validator = bv.Struct(RelocationBatchResultData) +class RelocationBatchResultEntry(bb.Union): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + _catch_all = 'other' + # Attribute is overwritten below the class definition + other = None + + @classmethod + def success(cls, val): + """ + Create an instance of this class set to the ``success`` tag with value + ``val``. + + :param Metadata val: + :rtype: RelocationBatchResultEntry + """ + return cls('success', val) + + @classmethod + def failure(cls, val): + """ + Create an instance of this class set to the ``failure`` tag with value + ``val``. + + :param RelocationBatchErrorEntry val: + :rtype: RelocationBatchResultEntry + """ + return cls('failure', val) + + def is_success(self): + """ + Check if the union tag is ``success``. + + :rtype: bool + """ + return self._tag == 'success' + + def is_failure(self): + """ + Check if the union tag is ``failure``. + + :rtype: bool + """ + return self._tag == 'failure' + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == 'other' + + def get_success(self): + """ + Only call this if :meth:`is_success` is true. + + :rtype: Metadata + """ + if not self.is_success(): + raise AttributeError("tag 'success' not set") + return self._value + + def get_failure(self): + """ + Only call this if :meth:`is_failure` is true. + + :rtype: RelocationBatchErrorEntry + """ + if not self.is_failure(): + raise AttributeError("tag 'failure' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, processor): + super(RelocationBatchResultEntry, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'RelocationBatchResultEntry(%r, %r)' % (self._tag, self._value) + +RelocationBatchResultEntry_validator = bv.Union(RelocationBatchResultEntry) + +class RelocationBatchV2JobStatus(async_.PollResultBase): + """ + Result returned by :meth:`dropbox.dropbox.Dropbox.files_copy_batch` or + :meth:`dropbox.dropbox.Dropbox.files_move_batch` that may either launch an + asynchronous job or complete synchronously. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar RelocationBatchV2Result complete: The copy or move batch job has + finished. + """ + + @classmethod + def complete(cls, val): + """ + Create an instance of this class set to the ``complete`` tag with value + ``val``. + + :param RelocationBatchV2Result val: + :rtype: RelocationBatchV2JobStatus + """ + return cls('complete', val) + + def is_complete(self): + """ + Check if the union tag is ``complete``. + + :rtype: bool + """ + return self._tag == 'complete' + + def get_complete(self): + """ + The copy or move batch job has finished. + + Only call this if :meth:`is_complete` is true. + + :rtype: RelocationBatchV2Result + """ + if not self.is_complete(): + raise AttributeError("tag 'complete' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, processor): + super(RelocationBatchV2JobStatus, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'RelocationBatchV2JobStatus(%r, %r)' % (self._tag, self._value) + +RelocationBatchV2JobStatus_validator = bv.Union(RelocationBatchV2JobStatus) + +class RelocationBatchV2Launch(async_.LaunchResultBase): + """ + Result returned by :meth:`dropbox.dropbox.Dropbox.files_copy_batch` or + :meth:`dropbox.dropbox.Dropbox.files_move_batch` that may either launch an + asynchronous job or complete synchronously. + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + @classmethod + def complete(cls, val): + """ + Create an instance of this class set to the ``complete`` tag with value + ``val``. + + :param RelocationBatchV2Result val: + :rtype: RelocationBatchV2Launch + """ + return cls('complete', val) + + def is_complete(self): + """ + Check if the union tag is ``complete``. + + :rtype: bool + """ + return self._tag == 'complete' + + def get_complete(self): + """ + Only call this if :meth:`is_complete` is true. + + :rtype: RelocationBatchV2Result + """ + if not self.is_complete(): + raise AttributeError("tag 'complete' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, processor): + super(RelocationBatchV2Launch, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'RelocationBatchV2Launch(%r, %r)' % (self._tag, self._value) + +RelocationBatchV2Launch_validator = bv.Union(RelocationBatchV2Launch) + +class RelocationBatchV2Result(FileOpsResult): + """ + :ivar entries: Each entry in CopyBatchArg.entries or + ``MoveBatchArg.entries`` will appear at the same position inside + ``RelocationBatchV2Result.entries``. + """ + + __slots__ = [ + '_entries_value', + '_entries_present', + ] + + _has_required_fields = True + + def __init__(self, + entries=None): + super(RelocationBatchV2Result, self).__init__() + self._entries_value = None + self._entries_present = False + if entries is not None: + self.entries = entries + + @property + def entries(self): + """ + Each entry in CopyBatchArg.entries or ``MoveBatchArg.entries`` will + appear at the same position inside ``RelocationBatchV2Result.entries``. + + :rtype: list of [RelocationBatchResultEntry] + """ + if self._entries_present: + return self._entries_value + else: + raise AttributeError("missing required field 'entries'") + + @entries.setter + def entries(self, val): + val = self._entries_validator.validate(val) + self._entries_value = val + self._entries_present = True + + @entries.deleter + def entries(self): + self._entries_value = None + self._entries_present = False + + def _process_custom_annotations(self, annotation_type, processor): + super(RelocationBatchV2Result, self)._process_custom_annotations(annotation_type, processor) + + def __repr__(self): + return 'RelocationBatchV2Result(entries={!r})'.format( + self._entries_value, + ) + +RelocationBatchV2Result_validator = bv.Struct(RelocationBatchV2Result) + class RelocationResult(FileOpsResult): """ :ivar metadata: Metadata of the relocated object. @@ -8336,7 +8777,7 @@ def start(self): """ The starting index within the search results (used for paging). - :rtype: long + :rtype: int """ if self._start_present: return self._start_value @@ -8359,7 +8800,7 @@ def max_results(self): """ The maximum number of search results to return. - :rtype: long + :rtype: int """ if self._max_results_present: return self._max_results_value @@ -8756,7 +9197,7 @@ def start(self): :meth:`dropbox.dropbox.Dropbox.files_search` to fetch the next page of results. - :rtype: long + :rtype: int """ if self._start_present: return self._start_value @@ -9829,7 +10270,7 @@ def offset(self): sure upload data isn't lost or duplicated in the event of a network error. - :rtype: long + :rtype: int """ if self._offset_present: return self._offset_value @@ -10107,7 +10548,9 @@ def __repr__(self): class UploadSessionFinishBatchResult(bb.Struct): """ - :ivar entries: Commit result for each file in the batch. + :ivar entries: Each entry in ``UploadSessionFinishBatchArg.entries`` will + appear at the same position inside + ``UploadSessionFinishBatchResult.entries``. """ __slots__ = [ @@ -10127,7 +10570,8 @@ def __init__(self, @property def entries(self): """ - Commit result for each file in the batch. + Each entry in ``UploadSessionFinishBatchArg.entries`` will appear at the + same position inside ``UploadSessionFinishBatchResult.entries``. :rtype: list of [UploadSessionFinishBatchResultEntry] """ @@ -10526,7 +10970,7 @@ def correct_offset(self): """ The offset up to which data has been collected. - :rtype: long + :rtype: int """ if self._correct_offset_present: return self._correct_offset_value @@ -10788,7 +11232,7 @@ def duration(self): """ The duration of the video in milliseconds. - :rtype: long + :rtype: int """ if self._duration_present: return self._duration_value @@ -11135,6 +11579,8 @@ def __repr__(self): WriteMode_validator = bv.Union(WriteMode) +CopyBatchArg_validator = RelocationBatchArgBase_validator +CopyBatchArg = RelocationBatchArgBase FileId_validator = bv.String(min_length=4, pattern=u'id:.+') Id_validator = bv.String(min_length=1) ListFolderCursor_validator = bv.String(min_length=1) @@ -11922,6 +12368,21 @@ def __repr__(self): } MediaMetadata._is_catch_all_ = False +RelocationBatchArgBase._entries_validator = bv.List(RelocationPath_validator, min_items=1) +RelocationBatchArgBase._autorename_validator = bv.Boolean() +RelocationBatchArgBase._all_field_names_ = set([ + 'entries', + 'autorename', +]) +RelocationBatchArgBase._all_fields_ = [ + ('entries', RelocationBatchArgBase._entries_validator), + ('autorename', RelocationBatchArgBase._autorename_validator), +] + +MoveBatchArg._allow_ownership_transfer_validator = bv.Boolean() +MoveBatchArg._all_field_names_ = RelocationBatchArgBase._all_field_names_.union(set(['allow_ownership_transfer'])) +MoveBatchArg._all_fields_ = RelocationBatchArgBase._all_fields_ + [('allow_ownership_transfer', MoveBatchArg._allow_ownership_transfer_validator)] + PhotoMetadata._field_names_ = set([]) PhotoMetadata._all_field_names_ = MediaMetadata._all_field_names_.union(PhotoMetadata._field_names_) PhotoMetadata._fields_ = [] @@ -11978,20 +12439,14 @@ def __repr__(self): ('allow_ownership_transfer', RelocationArg._allow_ownership_transfer_validator), ] -RelocationBatchArg._entries_validator = bv.List(RelocationPath_validator, min_items=1) RelocationBatchArg._allow_shared_folder_validator = bv.Boolean() -RelocationBatchArg._autorename_validator = bv.Boolean() RelocationBatchArg._allow_ownership_transfer_validator = bv.Boolean() -RelocationBatchArg._all_field_names_ = set([ - 'entries', +RelocationBatchArg._all_field_names_ = RelocationBatchArgBase._all_field_names_.union(set([ 'allow_shared_folder', - 'autorename', 'allow_ownership_transfer', -]) -RelocationBatchArg._all_fields_ = [ - ('entries', RelocationBatchArg._entries_validator), +])) +RelocationBatchArg._all_fields_ = RelocationBatchArgBase._all_fields_ + [ ('allow_shared_folder', RelocationBatchArg._allow_shared_folder_validator), - ('autorename', RelocationBatchArg._autorename_validator), ('allow_ownership_transfer', RelocationBatchArg._allow_ownership_transfer_validator), ] @@ -12005,6 +12460,7 @@ def __repr__(self): RelocationError._duplicated_or_nested_paths_validator = bv.Void() RelocationError._cant_transfer_ownership_validator = bv.Void() RelocationError._insufficient_quota_validator = bv.Void() +RelocationError._internal_error_validator = bv.Void() RelocationError._other_validator = bv.Void() RelocationError._tagmap = { 'from_lookup': RelocationError._from_lookup_validator, @@ -12017,6 +12473,7 @@ def __repr__(self): 'duplicated_or_nested_paths': RelocationError._duplicated_or_nested_paths_validator, 'cant_transfer_ownership': RelocationError._cant_transfer_ownership_validator, 'insufficient_quota': RelocationError._insufficient_quota_validator, + 'internal_error': RelocationError._internal_error_validator, 'other': RelocationError._other_validator, } @@ -12027,6 +12484,7 @@ def __repr__(self): RelocationError.duplicated_or_nested_paths = RelocationError('duplicated_or_nested_paths') RelocationError.cant_transfer_ownership = RelocationError('cant_transfer_ownership') RelocationError.insufficient_quota = RelocationError('insufficient_quota') +RelocationError.internal_error = RelocationError('internal_error') RelocationError.other = RelocationError('other') RelocationBatchError._too_many_write_operations_validator = bv.Void() @@ -12037,6 +12495,21 @@ def __repr__(self): RelocationBatchError.too_many_write_operations = RelocationBatchError('too_many_write_operations') +RelocationBatchErrorEntry._relocation_error_validator = RelocationError_validator +RelocationBatchErrorEntry._internal_error_validator = bv.Void() +RelocationBatchErrorEntry._too_many_write_operations_validator = bv.Void() +RelocationBatchErrorEntry._other_validator = bv.Void() +RelocationBatchErrorEntry._tagmap = { + 'relocation_error': RelocationBatchErrorEntry._relocation_error_validator, + 'internal_error': RelocationBatchErrorEntry._internal_error_validator, + 'too_many_write_operations': RelocationBatchErrorEntry._too_many_write_operations_validator, + 'other': RelocationBatchErrorEntry._other_validator, +} + +RelocationBatchErrorEntry.internal_error = RelocationBatchErrorEntry('internal_error') +RelocationBatchErrorEntry.too_many_write_operations = RelocationBatchErrorEntry('too_many_write_operations') +RelocationBatchErrorEntry.other = RelocationBatchErrorEntry('other') + RelocationBatchJobStatus._complete_validator = RelocationBatchResult_validator RelocationBatchJobStatus._failed_validator = RelocationBatchError_validator RelocationBatchJobStatus._tagmap = { @@ -12063,6 +12536,33 @@ def __repr__(self): RelocationBatchResultData._all_field_names_ = set(['metadata']) RelocationBatchResultData._all_fields_ = [('metadata', RelocationBatchResultData._metadata_validator)] +RelocationBatchResultEntry._success_validator = Metadata_validator +RelocationBatchResultEntry._failure_validator = RelocationBatchErrorEntry_validator +RelocationBatchResultEntry._other_validator = bv.Void() +RelocationBatchResultEntry._tagmap = { + 'success': RelocationBatchResultEntry._success_validator, + 'failure': RelocationBatchResultEntry._failure_validator, + 'other': RelocationBatchResultEntry._other_validator, +} + +RelocationBatchResultEntry.other = RelocationBatchResultEntry('other') + +RelocationBatchV2JobStatus._complete_validator = RelocationBatchV2Result_validator +RelocationBatchV2JobStatus._tagmap = { + 'complete': RelocationBatchV2JobStatus._complete_validator, +} +RelocationBatchV2JobStatus._tagmap.update(async_.PollResultBase._tagmap) + +RelocationBatchV2Launch._complete_validator = RelocationBatchV2Result_validator +RelocationBatchV2Launch._tagmap = { + 'complete': RelocationBatchV2Launch._complete_validator, +} +RelocationBatchV2Launch._tagmap.update(async_.LaunchResultBase._tagmap) + +RelocationBatchV2Result._entries_validator = bv.List(RelocationBatchResultEntry_validator) +RelocationBatchV2Result._all_field_names_ = FileOpsResult._all_field_names_.union(set(['entries'])) +RelocationBatchV2Result._all_fields_ = FileOpsResult._all_fields_ + [('entries', RelocationBatchV2Result._entries_validator)] + RelocationResult._metadata_validator = Metadata_validator RelocationResult._all_field_names_ = FileOpsResult._all_field_names_.union(set(['metadata'])) RelocationResult._all_fields_ = FileOpsResult._all_fields_ + [('metadata', RelocationResult._metadata_validator)] @@ -12638,20 +13138,40 @@ def __repr__(self): {'host': u'api', 'style': u'rpc'}, ) +copy_batch_v2 = bb.Route( + 'copy_batch', + 2, + False, + CopyBatchArg_validator, + RelocationBatchV2Launch_validator, + bv.Void(), + {'host': u'api', + 'style': u'rpc'}, +) copy_batch = bb.Route( 'copy_batch', 1, - False, + True, RelocationBatchArg_validator, RelocationBatchLaunch_validator, bv.Void(), {'host': u'api', 'style': u'rpc'}, ) +copy_batch_check_v2 = bb.Route( + 'copy_batch/check', + 2, + False, + async_.PollArg_validator, + RelocationBatchV2JobStatus_validator, + async_.PollError_validator, + {'host': u'api', + 'style': u'rpc'}, +) copy_batch_check = bb.Route( 'copy_batch/check', 1, - False, + True, async_.PollArg_validator, RelocationBatchJobStatus_validator, async_.PollError_validator, @@ -12908,6 +13428,16 @@ def __repr__(self): {'host': u'api', 'style': u'rpc'}, ) +move_batch_v2 = bb.Route( + 'move_batch', + 2, + False, + MoveBatchArg_validator, + RelocationBatchV2Launch_validator, + bv.Void(), + {'host': u'api', + 'style': u'rpc'}, +) move_batch = bb.Route( 'move_batch', 1, @@ -12918,6 +13448,16 @@ def __repr__(self): {'host': u'api', 'style': u'rpc'}, ) +move_batch_check_v2 = bb.Route( + 'move_batch/check', + 2, + False, + async_.PollArg_validator, + RelocationBatchV2JobStatus_validator, + async_.PollError_validator, + {'host': u'api', + 'style': u'rpc'}, +) move_batch_check = bb.Route( 'move_batch/check', 1, @@ -13114,7 +13654,9 @@ def __repr__(self): 'alpha/upload': alpha_upload, 'copy:2': copy_v2, 'copy': copy, + 'copy_batch:2': copy_batch_v2, 'copy_batch': copy_batch, + 'copy_batch/check:2': copy_batch_check_v2, 'copy_batch/check': copy_batch_check, 'copy_reference/get': copy_reference_get, 'copy_reference/save': copy_reference_save, @@ -13141,7 +13683,9 @@ def __repr__(self): 'list_revisions': list_revisions, 'move:2': move_v2, 'move': move, + 'move_batch:2': move_batch_v2, 'move_batch': move_batch, + 'move_batch/check:2': move_batch_check_v2, 'move_batch/check': move_batch_check, 'permanently_delete': permanently_delete, 'properties/add': properties_add, diff --git a/dropbox/paper.py b/dropbox/paper.py index 22a7365c..9c74ee9b 100644 --- a/dropbox/paper.py +++ b/dropbox/paper.py @@ -1399,7 +1399,7 @@ def limit(self): Size limit per batch. The maximum number of docs that can be retrieved per batch is 1000. Higher value results in invalid arguments error. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -1872,7 +1872,7 @@ def limit(self): Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. Higher value results in invalid arguments error. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -2166,7 +2166,7 @@ def limit(self): Size limit per batch. The maximum number of users that can be retrieved per batch is 1000. Higher value results in invalid arguments error. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -2773,7 +2773,7 @@ def revision(self): """ The Paper doc revision. Simply an ever increasing number. - :rtype: long + :rtype: int """ if self._revision_present: return self._revision_value @@ -2971,7 +2971,7 @@ def revision(self): """ The Paper doc revision. Simply an ever increasing number. - :rtype: long + :rtype: int """ if self._revision_present: return self._revision_value @@ -3200,7 +3200,7 @@ def revision(self): The latest doc revision. This value must match the head revision or an error code will be returned. This is to prevent colliding writes. - :rtype: long + :rtype: int """ if self._revision_present: return self._revision_value diff --git a/dropbox/sharing.py b/dropbox/sharing.py index cbf6111d..e87a81fd 100644 --- a/dropbox/sharing.py +++ b/dropbox/sharing.py @@ -725,8 +725,8 @@ class AddFolderMemberError(bb.Union): contains a bad invitation recipient. :ivar cant_share_outside_team: Your team policy does not allow sharing outside of the team. - :ivar long too_many_members: The value is the member limit that was reached. - :ivar long too_many_pending_invites: The value is the pending invite limit + :ivar int too_many_members: The value is the member limit that was reached. + :ivar int too_many_pending_invites: The value is the pending invite limit that was reached. :ivar rate_limit: The current user has hit the limit of invites they can send per day. Try again in 24 hours. @@ -787,7 +787,7 @@ def too_many_members(cls, val): Create an instance of this class set to the ``too_many_members`` tag with value ``val``. - :param long val: + :param int val: :rtype: AddFolderMemberError """ return cls('too_many_members', val) @@ -798,7 +798,7 @@ def too_many_pending_invites(cls, val): Create an instance of this class set to the ``too_many_pending_invites`` tag with value ``val``. - :param long val: + :param int val: :rtype: AddFolderMemberError """ return cls('too_many_pending_invites', val) @@ -929,7 +929,7 @@ def get_too_many_members(self): Only call this if :meth:`is_too_many_members` is true. - :rtype: long + :rtype: int """ if not self.is_too_many_members(): raise AttributeError("tag 'too_many_members' not set") @@ -941,7 +941,7 @@ def get_too_many_pending_invites(self): Only call this if :meth:`is_too_many_pending_invites` is true. - :rtype: long + :rtype: int """ if not self.is_too_many_pending_invites(): raise AttributeError("tag 'too_many_pending_invites' not set") @@ -1299,7 +1299,7 @@ def __init__(self, @property def count(self): """ - :rtype: long + :rtype: int """ if self._count_present: return self._count_value @@ -3152,7 +3152,7 @@ def size(self): """ The file size in bytes. - :rtype: long + :rtype: int """ if self._size_present: return self._size_value @@ -5729,7 +5729,7 @@ def space_needed(self): """ The amount of space needed to add the item (the size of the item). - :rtype: long + :rtype: int """ if self._space_needed_present: return self._space_needed_value @@ -5752,7 +5752,7 @@ def space_shortage(self): """ The amount of extra space needed to add the item. - :rtype: long + :rtype: int """ if self._space_shortage_present: return self._space_shortage_value @@ -5775,7 +5775,7 @@ def space_left(self): """ The amount of space left in the user's Dropbox, less than space_needed. - :rtype: long + :rtype: int """ if self._space_left_present: return self._space_left_value @@ -7057,7 +7057,7 @@ def limit(self): Number of members to return max per query. Defaults to 100 if no limit is specified. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -7148,7 +7148,7 @@ def limit(self): Number of members to return max per query. Defaults to 10 if no limit is specified. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -7482,7 +7482,7 @@ def member_count(self): The number of members on this file. This does not include inherited members. - :rtype: long + :rtype: int """ if self._member_count_present: return self._member_count_value @@ -7731,7 +7731,7 @@ def limit(self): Number of files to return max per query. Defaults to 100 if no limit is specified. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -8071,7 +8071,7 @@ def limit(self): The maximum number of results that include members, groups and invitees to return per request. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -8317,7 +8317,7 @@ def limit(self): """ The maximum number of results to return per request. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value diff --git a/dropbox/team.py b/dropbox/team.py index 1f3a9e7e..8f744a1a 100644 --- a/dropbox/team.py +++ b/dropbox/team.py @@ -1584,7 +1584,7 @@ def windows(self): """ Array of number of linked windows (desktop) clients with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._windows_present: return self._windows_value @@ -1607,7 +1607,7 @@ def macos(self): """ Array of number of linked mac (desktop) clients with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._macos_present: return self._macos_value @@ -1630,7 +1630,7 @@ def linux(self): """ Array of number of linked linus (desktop) clients with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._linux_present: return self._linux_value @@ -1653,7 +1653,7 @@ def ios(self): """ Array of number of linked ios devices with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._ios_present: return self._ios_value @@ -1676,7 +1676,7 @@ def android(self): """ Array of number of linked android devices with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._android_present: return self._android_value @@ -1700,7 +1700,7 @@ def other(self): Array of number of other linked devices (blackberry, windows phone, etc) with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._other_present: return self._other_value @@ -1723,7 +1723,7 @@ def total(self): """ Array of total number of linked clients with activity. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._total_present: return self._total_value @@ -1783,7 +1783,7 @@ def limit(self): """ Number of results to return per call. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -2790,7 +2790,7 @@ def adds(self): """ Array of total number of adds by team members. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._adds_present: return self._adds_value @@ -2814,7 +2814,7 @@ def edits(self): Array of number of edits by team members. If the same user edits the same file multiple times this is counted as a single edit. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._edits_present: return self._edits_value @@ -2837,7 +2837,7 @@ def deletes(self): """ Array of total number of deletes by team members. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._deletes_present: return self._deletes_value @@ -2860,7 +2860,7 @@ def active_users_28_day(self): """ Array of the number of users who have been active in the last 28 days. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._active_users_28_day_present: return self._active_users_28_day_value @@ -2883,7 +2883,7 @@ def active_users_7_day(self): """ Array of the number of users who have been active in the last week. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._active_users_7_day_present: return self._active_users_7_day_value @@ -2906,7 +2906,7 @@ def active_users_1_day(self): """ Array of the number of users who have been active in the last day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._active_users_1_day_present: return self._active_users_1_day_value @@ -2930,7 +2930,7 @@ def active_shared_folders_28_day(self): Array of the number of shared folders with some activity in the last 28 days. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._active_shared_folders_28_day_present: return self._active_shared_folders_28_day_value @@ -2954,7 +2954,7 @@ def active_shared_folders_7_day(self): Array of the number of shared folders with some activity in the last week. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._active_shared_folders_7_day_present: return self._active_shared_folders_7_day_value @@ -2978,7 +2978,7 @@ def active_shared_folders_1_day(self): Array of the number of shared folders with some activity in the last day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._active_shared_folders_1_day_present: return self._active_shared_folders_1_day_value @@ -3001,7 +3001,7 @@ def shared_links_created(self): """ Array of the number of shared links created. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_links_created_present: return self._shared_links_created_value @@ -3025,7 +3025,7 @@ def shared_links_viewed_by_team(self): Array of the number of views by team users to shared links created by the team. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_links_viewed_by_team_present: return self._shared_links_viewed_by_team_value @@ -3049,7 +3049,7 @@ def shared_links_viewed_by_outside_user(self): Array of the number of views by users outside of the team to shared links created by the team. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_links_viewed_by_outside_user_present: return self._shared_links_viewed_by_outside_user_value @@ -3073,7 +3073,7 @@ def shared_links_viewed_by_not_logged_in(self): Array of the number of views by non-logged-in users to shared links created by the team. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_links_viewed_by_not_logged_in_present: return self._shared_links_viewed_by_not_logged_in_value @@ -3096,7 +3096,7 @@ def shared_links_viewed_total(self): """ Array of the total number of views to shared links created by the team. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_links_viewed_total_present: return self._shared_links_viewed_total_value @@ -3328,7 +3328,7 @@ def team_size(self): """ Team size, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._team_size_present: return self._team_size_value @@ -3351,7 +3351,7 @@ def pending_invites(self): """ The number of pending invites to the team, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._pending_invites_present: return self._pending_invites_value @@ -3374,7 +3374,7 @@ def members_joined(self): """ The number of members that joined the team, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._members_joined_present: return self._members_joined_value @@ -3397,7 +3397,7 @@ def suspended_members(self): """ The number of suspended team members, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._suspended_members_present: return self._suspended_members_value @@ -3420,7 +3420,7 @@ def licenses(self): """ The total number of licenses the team has, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._licenses_present: return self._licenses_value @@ -3524,7 +3524,7 @@ def total_usage(self): """ Sum of the shared, unshared, and datastore usages, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._total_usage_present: return self._total_usage_value @@ -3548,7 +3548,7 @@ def shared_usage(self): Array of the combined size (bytes) of team members' shared folders, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_usage_present: return self._shared_usage_value @@ -3572,7 +3572,7 @@ def unshared_usage(self): Array of the combined size (bytes) of team members' root namespaces, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._unshared_usage_present: return self._unshared_usage_value @@ -3596,7 +3596,7 @@ def shared_folders(self): Array of the number of shared folders owned by team members, for each day. - :rtype: list of [Optional[long]] + :rtype: list of [Optional[int]] """ if self._shared_folders_present: return self._shared_folders_value @@ -4074,7 +4074,7 @@ def created(self): The group creation time as a UTC timestamp in milliseconds since the Unix epoch. - :rtype: long + :rtype: int """ if self._created_present: return self._created_value @@ -5577,7 +5577,7 @@ def limit(self): """ Number of results to return per call. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -5874,7 +5874,7 @@ def limit(self): """ Number of results to return per call. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -10162,7 +10162,7 @@ def limit(self): """ Number of results to return per call. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -13462,7 +13462,7 @@ def users(self): The number of people whose storage is in the range of this storage bucket. - :rtype: long + :rtype: int """ if self._users_present: return self._users_value @@ -14217,7 +14217,7 @@ def limit(self): """ The maximum number of results to return per request. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -15199,7 +15199,7 @@ def num_licensed_users(self): """ The number of licenses available to the team. - :rtype: long + :rtype: int """ if self._num_licensed_users_present: return self._num_licensed_users_value @@ -15223,7 +15223,7 @@ def num_provisioned_users(self): The number of accounts that have been invited or are already active members of the team. - :rtype: long + :rtype: int """ if self._num_provisioned_users_present: return self._num_provisioned_users_value @@ -15636,7 +15636,7 @@ def limit(self): """ Specifying a value here has no effect. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -16032,7 +16032,7 @@ class UploadApiRateLimitValue(bb.Union): :ivar unlimited: This team has unlimited upload API quota. So far both server version account and legacy account type have unlimited monthly upload api quota. - :ivar long limit: The number of upload API calls allowed per month. + :ivar int limit: The number of upload API calls allowed per month. """ _catch_all = 'other' @@ -16047,7 +16047,7 @@ def limit(cls, val): Create an instance of this class set to the ``limit`` tag with value ``val``. - :param long val: + :param int val: :rtype: UploadApiRateLimitValue """ return cls('limit', val) @@ -16082,7 +16082,7 @@ def get_limit(self): Only call this if :meth:`is_limit` is true. - :rtype: long + :rtype: int """ if not self.is_limit(): raise AttributeError("tag 'limit' not set") @@ -16146,7 +16146,7 @@ def user(self): @property def quota_gb(self): """ - :rtype: long + :rtype: int """ if self._quota_gb_present: return self._quota_gb_value @@ -16226,7 +16226,7 @@ def user(self): @property def quota_gb(self): """ - :rtype: long + :rtype: int """ if self._quota_gb_present: return self._quota_gb_value diff --git a/dropbox/team_common.py b/dropbox/team_common.py index 0601d62c..35a8cc3e 100644 --- a/dropbox/team_common.py +++ b/dropbox/team_common.py @@ -208,7 +208,7 @@ def member_count(self): """ The number of members in the group. - :rtype: long + :rtype: int """ if self._member_count_present: return self._member_count_value diff --git a/dropbox/team_log.py b/dropbox/team_log.py index 620ad30d..016d0499 100644 --- a/dropbox/team_log.py +++ b/dropbox/team_log.py @@ -4639,7 +4639,7 @@ def num_failures(self): """ The number of times that remote file deletion failed. - :rtype: long + :rtype: int """ if self._num_failures_present: return self._num_failures_value @@ -5899,7 +5899,7 @@ def num_recipients(self): """ Number of recipients. - :rtype: long + :rtype: int """ if self._num_recipients_present: return self._num_recipients_value @@ -6662,7 +6662,7 @@ def amount(self): """ Amount of time. - :rtype: long + :rtype: int """ if self._amount_present: return self._amount_value @@ -29881,7 +29881,7 @@ def asset_index(self): """ Asset position in the Assets list. - :rtype: long + :rtype: int """ if self._asset_index_present: return self._asset_index_value @@ -31372,7 +31372,7 @@ def limit(self): fetch again using :meth:`dropbox.dropbox.Dropbox.team_log_get_events_continue`. - :rtype: long + :rtype: int """ if self._limit_present: return self._limit_value @@ -36071,7 +36071,7 @@ def new_value(self): """ New custom quota value in bytes. - :rtype: long + :rtype: int """ if self._new_value_present: return self._new_value_value @@ -36381,7 +36381,7 @@ def previous_value(self): """ Previous custom quota value in bytes. - :rtype: long + :rtype: int """ if self._previous_value_present: return self._previous_value_value @@ -36404,7 +36404,7 @@ def new_value(self): """ New custom quota value in bytes. - :rtype: long + :rtype: int """ if self._new_value_present: return self._new_value_value @@ -36517,7 +36517,7 @@ def previous_value(self): Previous team default limit value in bytes. Might be missing due to historical data gap. - :rtype: long + :rtype: int """ if self._previous_value_present: return self._previous_value_value @@ -36544,7 +36544,7 @@ def new_value(self): New team default limit value in bytes. Might be missing due to historical data gap. - :rtype: long + :rtype: int """ if self._new_value_present: return self._new_value_value @@ -39578,7 +39578,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -39601,7 +39601,7 @@ def parent_asset_index(self): """ Parent asset position in the Assets list. - :rtype: long + :rtype: int """ if self._parent_asset_index_present: return self._parent_asset_index_value @@ -40046,7 +40046,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -40069,7 +40069,7 @@ def parent_asset_index(self): """ Parent asset position in the Assets list. - :rtype: long + :rtype: int """ if self._parent_asset_index_present: return self._parent_asset_index_value @@ -44939,7 +44939,7 @@ def src_asset_index(self): """ Source asset position in the Assets list. - :rtype: long + :rtype: int """ if self._src_asset_index_present: return self._src_asset_index_value @@ -44962,7 +44962,7 @@ def dest_asset_index(self): """ Destination asset position in the Assets list. - :rtype: long + :rtype: int """ if self._dest_asset_index_present: return self._dest_asset_index_value @@ -45444,7 +45444,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -45637,7 +45637,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -45815,7 +45815,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46021,7 +46021,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46218,7 +46218,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46378,7 +46378,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46503,7 +46503,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46612,7 +46612,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46763,7 +46763,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -46960,7 +46960,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -47120,7 +47120,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -47223,7 +47223,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -47457,7 +47457,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value @@ -58324,7 +58324,7 @@ def previous_value(self): """ Previous single sign-on identity mode. - :rtype: long + :rtype: int """ if self._previous_value_present: return self._previous_value_value @@ -58347,7 +58347,7 @@ def new_value(self): """ New single sign-on identity mode. - :rtype: long + :rtype: int """ if self._new_value_present: return self._new_value_value @@ -59542,7 +59542,7 @@ def target_asset_index(self): """ Target asset position in the Assets list. - :rtype: long + :rtype: int """ if self._target_asset_index_present: return self._target_asset_index_value diff --git a/dropbox/users.py b/dropbox/users.py index 52806879..4bebb3cd 100644 --- a/dropbox/users.py +++ b/dropbox/users.py @@ -1092,7 +1092,7 @@ def allocated(self): """ The total space allocated to the user's account (bytes). - :rtype: long + :rtype: int """ if self._allocated_present: return self._allocated_value @@ -1440,7 +1440,7 @@ def used(self): """ The user's total space usage (bytes). - :rtype: long + :rtype: int """ if self._used_present: return self._used_value @@ -1543,7 +1543,7 @@ def used(self): """ The total space currently used by the user's team (bytes). - :rtype: long + :rtype: int """ if self._used_present: return self._used_value @@ -1566,7 +1566,7 @@ def allocated(self): """ The total space allocated to the user's team (bytes). - :rtype: long + :rtype: int """ if self._allocated_present: return self._allocated_value @@ -1591,7 +1591,7 @@ def user_within_team_space_allocated(self): means that no restriction is imposed on the user's quota within its team). - :rtype: long + :rtype: int """ if self._user_within_team_space_allocated_present: return self._user_within_team_space_allocated_value diff --git a/spec b/spec index eb70e699..097e9ba0 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit eb70e699275c6bacb6eb80b3ce5617833b5f9c70 +Subproject commit 097e9ba0d39ecf2f9e97e24ecd9874983d3cef1d diff --git a/stone b/stone index 1a5cb6d9..4d2348cf 160000 --- a/stone +++ b/stone @@ -1 +1 @@ -Subproject commit 1a5cb6d9eab6383dccd12678c3b8723e2a9317d5 +Subproject commit 4d2348cff28424f4bd4229cca2365a70e1d428ec