Commit 1317cc2f authored by Michael Fladischer's avatar Michael Fladischer

Update upstream source from tag 'upstream/9.4.0'

Update to upstream version '9.4.0'
with Debian dir 607e3ba2ed4df33b80a3b33a331378bfcf6debed
parents 3ff69c6e bb2bb599
......@@ -12,3 +12,4 @@ __pycache__/
*.pyc
*.pyo
*~
.venv
\ No newline at end of file
[MESSAGES CONTROL]
disable=C,R,file-ignored,fixme,locally-disabled,protected-access,useless-else-on-loop
disable=C,R,file-ignored,fixme,locally-disabled,protected-access,useless-else-on-loop,unnecessary-pass
enable=useless-suppression
[REPORTS]
......
# .readthedocs.yml
# Don't build any extra formats
# https://docs.readthedocs.io/en/latest/yaml-config.html#formats
formats: []
Dropbox for Python
==================
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v9.3.0
.. image:: https://travis-ci.org/dropbox/dropbox-sdk-python.svg?branch=v9.4.0
:target: https://travis-ci.org/dropbox/dropbox-sdk-python
.. image:: https://readthedocs.org/projects/dropbox-sdk-python/badge/?version=stable
......
:mod:`dropbox.async_` -- Async
==============================
*As of Python 3.5,* ``async`` *is a reserved keyword. For versions of Python prior to 3.5, the objects documented can be imported from either* ``dropbox.async`` *or* ``dropbox.async_``. *For Python 3.5+, only* ``dropbox.async_`` *is supported.*
.. automodule:: dropbox.async_
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.auth` -- Auth
===========================
.. automodule:: dropbox.auth
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.common` -- Common
===============================
.. automodule:: dropbox.common
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.contacts` -- Contacts
===================================
.. automodule:: dropbox.contacts
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.dropbox` -- Dropbox
=================================
.. automodule:: dropbox.dropbox
:members:
:show-inheritance:
:inherited-members:
:special-members: __init__
:undoc-members:
:mod:`dropbox.exceptions` -- Exceptions
=======================================
.. automodule:: dropbox.exceptions
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.file_properties` -- File Properties
=================================================
.. automodule:: dropbox.file_properties
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.file_requests` -- File Requests
=============================================
.. automodule:: dropbox.file_requests
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.files` -- Files
=============================
.. automodule:: dropbox.files
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.oauth` -- OAuth
=============================
.. automodule:: dropbox.oauth
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.paper` -- Paper
=============================
.. automodule:: dropbox.paper
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.seen_state` -- Seen State
=======================================
.. automodule:: dropbox.seen_state
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.sharing` -- Sharing
=================================
.. automodule:: dropbox.sharing
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team` -- Team
===========================
.. automodule:: dropbox.team
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team_common` -- Team Common
=========================================
.. automodule:: dropbox.team_common
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team_log` -- Team Log
===================================
.. automodule:: dropbox.team_log
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team_policies` -- Team Policies
=============================================
.. automodule:: dropbox.team_policies
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.users` -- Users
=============================
.. automodule:: dropbox.users
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.users_common` -- Users Common
===========================================
.. automodule:: dropbox.users_common
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
......@@ -54,7 +54,7 @@ master_doc = 'index'
# General information about the project.
project = u'Dropbox for Python'
copyright = u'2015-2017, Dropbox, Inc.'
copyright = u'2015-2019, Dropbox, Inc.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......
......@@ -9,7 +9,25 @@ Dropbox for Python Documentation
.. toctree::
:maxdepth: 2
moduledoc
api/async
api/auth
api/common
api/contacts
api/dropbox
api/exceptions
api/file_properties
api/file_requests
api/files
api/oauth
api/paper
api/seen_state
api/sharing
api/team
api/team_common
api/team_log
api/team_policies
api/users
api/users_common
Indices and tables
==================
......
*****************
SDK Documentation
*****************
:mod:`dropbox.async` -- Async
============================================
.. automodule:: dropbox.async
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.auth` -- Auth
============================================
.. automodule:: dropbox.auth
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.common` -- Common
============================================
.. automodule:: dropbox.common
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.contacts` -- Contacts
============================================
.. automodule:: dropbox.contacts
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.dropbox` -- Dropbox
============================================
.. automodule:: dropbox.dropbox
:members:
:show-inheritance:
:inherited-members:
:special-members: __init__
:undoc-members:
:mod:`dropbox.exceptions` -- Exceptions
============================================
.. automodule:: dropbox.exceptions
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.file_properties` -- File Properties
============================================
.. automodule:: dropbox.file_properties
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.file_requests` -- File Requests
============================================
.. automodule:: dropbox.file_requests
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.files` -- Files
============================================
.. automodule:: dropbox.files
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.oauth` -- OAuth
============================================
.. automodule:: dropbox.oauth
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.paper` -- Paper
============================================
.. automodule:: dropbox.paper
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.seen_state` -- Seen State
============================================
.. automodule:: dropbox.seen_state
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.sharing` -- Sharing
============================================
.. automodule:: dropbox.sharing
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team` -- Team
============================================
.. automodule:: dropbox.team
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team_common` -- Team Common
============================================
.. automodule:: dropbox.team_common
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team_log` -- Team Log
============================================
.. automodule:: dropbox.team_log
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.team_policies` -- Team Policies
============================================
.. automodule:: dropbox.team_policies
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.users` -- Users
============================================
.. automodule:: dropbox.users
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
:mod:`dropbox.users_common` -- Users Common
============================================
.. automodule:: dropbox.users_common
:members:
:show-inheritance:
:special-members: __init__
:undoc-members:
......@@ -4,4 +4,4 @@
# flake8: noqa
# pylint: skip-file
# If you have issues importing this module because Python recognizes it as a keyword, use async_ instead.
from async_ import *
from .async_ import *
......@@ -24,9 +24,9 @@ class LaunchResultBase(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar str async_job_id: This response indicates that the processing is
asynchronous. The string is an id that can be used to obtain the status
of the asynchronous job.
:ivar str async.LaunchResultBase.async_job_id: This response indicates that
the processing is asynchronous. The string is an id that can be used to
obtain the status of the asynchronous job.
"""
_catch_all = None
......@@ -63,8 +63,8 @@ class LaunchResultBase(bb.Union):
raise AttributeError("tag 'async_job_id' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(LaunchResultBase, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LaunchResultBase, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LaunchResultBase(%r, %r)' % (self._tag, self._value)
......@@ -81,7 +81,8 @@ class LaunchEmptyResult(LaunchResultBase):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar complete: The job finished synchronously and successfully.
:ivar async.LaunchEmptyResult.complete: The job finished synchronously and
successfully.
"""
# Attribute is overwritten below the class definition
......@@ -95,8 +96,8 @@ class LaunchEmptyResult(LaunchResultBase):
"""
return self._tag == 'complete'
def _process_custom_annotations(self, annotation_type, processor):
super(LaunchEmptyResult, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LaunchEmptyResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LaunchEmptyResult(%r, %r)' % (self._tag, self._value)
......@@ -107,8 +108,8 @@ class PollArg(bb.Struct):
"""
Arguments for methods that poll the status of an asynchronous job.
:ivar async_job_id: Id of the asynchronous job. This is the value of a
response returned from the method that launched the job.
:ivar async.PollArg.async_job_id: Id of the asynchronous job. This is the
value of a response returned from the method that launched the job.
"""
__slots__ = [
......@@ -149,8 +150,8 @@ class PollArg(bb.Struct):
self._async_job_id_value = None
self._async_job_id_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(PollArg, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PollArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PollArg(async_job_id={!r})'.format(
......@@ -170,7 +171,8 @@ class PollResultBase(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar in_progress: The asynchronous job is still in progress.
:ivar async.PollResultBase.in_progress: The asynchronous job is still in
progress.
"""
_catch_all = None
......@@ -185,8 +187,8 @@ class PollResultBase(bb.Union):
"""
return self._tag == 'in_progress'
def _process_custom_annotations(self, annotation_type, processor):
super(PollResultBase, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PollResultBase, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PollResultBase(%r, %r)' % (self._tag, self._value)
......@@ -202,7 +204,8 @@ class PollEmptyResult(PollResultBase):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar complete: The asynchronous job has completed successfully.
:ivar async.PollEmptyResult.complete: The asynchronous job has completed
successfully.
"""
# Attribute is overwritten below the class definition
......@@ -216,8 +219,8 @@ class PollEmptyResult(PollResultBase):
"""
return self._tag == 'complete'
def _process_custom_annotations(self, annotation_type, processor):
super(PollEmptyResult, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PollEmptyResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PollEmptyResult(%r, %r)' % (self._tag, self._value)
......@@ -232,10 +235,10 @@ class PollError(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar invalid_async_job_id: The job ID is invalid.
: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 async.PollError.invalid_async_job_id: The job ID is invalid.
:ivar async.PollError.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'
......@@ -270,8 +273,8 @@ class PollError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(PollError, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PollError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PollError(%r, %r)' % (self._tag, self._value)
......
......@@ -21,10 +21,10 @@ class AccessError(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar InvalidAccountTypeError invalid_account_type: Current account type
cannot access the resource.
:ivar PaperAccessError paper_access_denied: Current account cannot access
Paper.
:ivar InvalidAccountTypeError AccessError.invalid_account_type: Current
account type cannot access the resource.
:ivar PaperAccessError AccessError.paper_access_denied: Current account
cannot access Paper.
"""
_catch_all = 'other'
......@@ -101,8 +101,8 @@ class AccessError(bb.Union):
raise AttributeError("tag 'paper_access_denied' not set")
return self._value
def _process_custom_annotations(self, annotation_type, processor):
super(AccessError, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AccessError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AccessError(%r, %r)' % (self._tag, self._value)
......@@ -117,13 +117,15 @@ class AuthError(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar invalid_access_token: The access token is invalid.
:ivar invalid_select_user: The user specified in 'Dropbox-API-Select-User'
is no longer on the team.
:ivar invalid_select_admin: The user specified in 'Dropbox-API-Select-Admin'
is not a Dropbox Business team admin.
:ivar user_suspended: The user has been suspended.
:ivar expired_access_token: The access token has expired.
:ivar auth.AuthError.invalid_access_token: The access token is invalid.
:ivar auth.AuthError.invalid_select_user: The user specified in
'Dropbox-API-Select-User' is no longer on the team.
:ivar auth.AuthError.invalid_select_admin: The user specified in
'Dropbox-API-Select-Admin' is not a Dropbox Business team admin.
:ivar auth.AuthError.user_suspended: The user has been suspended.
:ivar auth.AuthError.expired_access_token: The access token has expired.
:ivar TokenScopeError AuthError.missing_scope: The access token does not
have the required scope to access the route.
"""
_catch_all = 'other'
......@@ -140,6 +142,17 @@ class AuthError(bb.Union):
# Attribute is overwritten below the class definition
other = None
@classmethod
def missing_scope(cls, val):
"""
Create an instance of this class set to the ``missing_scope`` tag with
value ``val``.
:param TokenScopeError val:
:rtype: AuthError
"""
return cls('missing_scope', val)
def is_invalid_access_token(self):
"""
Check if the union tag is ``invalid_access_token``.
......@@ -180,6 +193,14 @@ class AuthError(bb.Union):
"""
return self._tag == 'expired_access_token'
def is_missing_scope(self):
"""
Check if the union tag is ``missing_scope``.
:rtype: bool
"""
return self._tag == 'missing_scope'
def is_other(self):
"""
Check if the union tag is ``other``.
......@@ -188,8 +209,20 @@ class AuthError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(AuthError, self)._process_custom_annotations(annotation_type, processor)
def get_missing_scope(self):
"""
The access token does not have the required scope to access the route.
Only call this if :meth:`is_missing_scope` is true.
:rtype: TokenScopeError
"""
if not self.is_missing_scope():
raise AttributeError("tag 'missing_scope' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AuthError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AuthError(%r, %r)' % (self._tag, self._value)
......@@ -202,10 +235,10 @@ class InvalidAccountTypeError(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar endpoint: Current account type doesn't have permission to access this
route endpoint.
:ivar feature: Current account type doesn't have permission to access this
feature.
:ivar auth.InvalidAccountTypeError.endpoint: Current account type doesn't
have permission to access this route endpoint.
:ivar auth.InvalidAccountTypeError.feature: Current account type doesn't
have permission to access this feature.
"""
_catch_all = 'other'
......@@ -240,8 +273,8 @@ class InvalidAccountTypeError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(InvalidAccountTypeError, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(InvalidAccountTypeError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'InvalidAccountTypeError(%r, %r)' % (self._tag, self._value)
......@@ -254,8 +287,9 @@ class PaperAccessError(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar paper_disabled: Paper is disabled.
:ivar not_paper_user: The provided user has not used Paper yet.
:ivar auth.PaperAccessError.paper_disabled: Paper is disabled.
:ivar auth.PaperAccessError.not_paper_user: The provided user has not used
Paper yet.
"""
_catch_all = 'other'
......@@ -290,8 +324,8 @@ class PaperAccessError(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(PaperAccessError, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PaperAccessError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PaperAccessError(%r, %r)' % (self._tag, self._value)
......@@ -302,9 +336,10 @@ class RateLimitError(bb.Struct):
"""
Error occurred because the app is being rate limited.
:ivar reason: The reason why the app is being rate limited.
:ivar retry_after: The number of seconds that the app should wait before
making another request.
:ivar auth.RateLimitError.reason: The reason why the app is being rate
limited.
:ivar auth.RateLimitError.retry_after: The number of seconds that the app
should wait before making another request.
"""
__slots__ = [
......@@ -375,8 +410,8 @@ class RateLimitError(bb.Struct):
self._retry_after_value = None
self._retry_after_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(RateLimitError, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RateLimitError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RateLimitError(reason={!r}, retry_after={!r})'.format(
......@@ -392,10 +427,10 @@ class RateLimitReason(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar too_many_requests: You are making too many requests in the past few
minutes.
:ivar too_many_write_operations: There are currently too many write
operations happening in the user's Dropbox.
:ivar auth.RateLimitReason.too_many_requests: You are making too many
requests in the past few minutes.
:ivar auth.RateLimitReason.too_many_write_operations: There are currently
too many write operations happening in the user's Dropbox.
"""
_catch_all = 'other'
......@@ -430,8 +465,8 @@ class RateLimitReason(bb.Union):
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, processor):
super(RateLimitReason, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RateLimitReason, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RateLimitReason(%r, %r)' % (self._tag, self._value)
......@@ -440,9 +475,10 @@ RateLimitReason_validator = bv.Union(RateLimitReason)
class TokenFromOAuth1Arg(bb.Struct):
"""
:ivar oauth1_token: The supplied OAuth 1.0 access token.
:ivar oauth1_token_secret: The token secret associated with the supplied
access token.
:ivar auth.TokenFromOAuth1Arg.oauth1_token: The supplied OAuth 1.0 access
token.
:ivar auth.TokenFromOAuth1Arg.oauth1_token_secret: The token secret
associated with the supplied access token.
"""
__slots__ = [
......@@ -512,8 +548,8 @@ class TokenFromOAuth1Arg(bb.Struct):
self._oauth1_token_secret_value = None
self._oauth1_token_secret_present = False
def _process_custom_annotations(self, annotation_type, processor):
super(TokenFromOAuth1Arg, self)._process_custom_annotations(annotation_type, processor)
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TokenFromOAuth1Arg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'TokenFromOAuth1Arg(oauth1_token={!r}, oauth1_token_secret={!r})'.format(
......@@ -529,10 +565,10 @@ class TokenFromOAuth1Error(bb.Union):
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar invalid_oauth1_token_info: Part or all of the OAuth 1.0 access token
info is invalid.
:ivar app_id_mismatch: The authorized app does not match the app associated
with the supplied access token.
:ivar auth.TokenFromOAuth1Error.invalid_oauth1_token_info: Part or all of
the OAuth 1.0 access token info is invalid.
:ivar auth.TokenFromOAuth1Error.app_id_mismatch: The authorized app does not