class _DropboxTransport(object): (source)
Known subclasses: dropbox.dropbox_client.Dropbox
, dropbox.dropbox_client.DropboxTeam
Responsible for implementing the wire protocol for making requests to the Dropbox API.
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
:param str oauth2_access_token: OAuth2 access token for making client requests. :param int max_retries_on_error: On 5xx errors, the number of times to retry. :param Optional[int] max_retries_on_rate_limit: On 429 errors, the number of times to retry... |
Method | check |
Checks if access token needs to be refreshed and refreshes if possible :return: |
Method | clone |
Creates a new copy of the Dropbox client with the same defaults unless modified by arguments to clone() |
Method | close |
Cleans up all resources like the request session/network connection. |
Method | raise |
Checks for errors from a res and handles appropiately. |
Method | refresh |
Refreshes an access token via refresh token if available |
Method | request |
Makes a request to the Dropbox API and in the process validates that the route argument and result are the expected data types. The request_arg is converted to JSON based on the arg_data_type. Likewise, the response is deserialized from JSON and converted to an object based on the {result,error}_data_type. |
Method | request |
Makes a request to the Dropbox API, taking a JSON-serializable Python object as an argument, and returning one as a response. |
Method | request |
See :meth:`request_json_string_with_retry` for description of parameters. |
Method | request |
See :meth:`request_json_object` for description of parameters. |
Method | with |
Creates a clone of the Dropbox instance with the Dropbox-API-Path-Root header as the appropriate serialized instance of PathRoot. |
Method | _get |
Returns the URL of the route. |
Method | _save |
Saves the body of an HTTP response to a file. |
Constant | _API |
Undocumented |
Constant | _ROUTE |
Undocumented |
Constant | _ROUTE |
Undocumented |
Constant | _ROUTE |
Undocumented |
Instance Variable | _app |
Undocumented |
Instance Variable | _app |
Undocumented |
Instance Variable | _headers |
Undocumented |
Instance Variable | _host |
Undocumented |
Instance Variable | _logger |
Undocumented |
Instance Variable | _max |
Undocumented |
Instance Variable | _max |
Undocumented |
Instance Variable | _oauth2 |
Undocumented |
Instance Variable | _oauth2 |
Undocumented |
Instance Variable | _oauth2 |
Undocumented |
Instance Variable | _raw |
Undocumented |
Instance Variable | _scope |
Undocumented |
Instance Variable | _session |
Undocumented |
Instance Variable | _timeout |
Undocumented |
Instance Variable | _user |
Undocumented |
:param str oauth2_access_token: OAuth2 access token for making client requests. :param int max_retries_on_error: On 5xx errors, the number of times to retry. :param Optional[int] max_retries_on_rate_limit: On 429 errors, the number of times to retry. If `None`, always retries. :param str user_agent: The user agent to use when making requests. This helps us identify requests coming from your application. We recommend you use the format "AppName/Version". If set, we append "/OfficialDropboxPythonSDKv2/__version__" to the user_agent, :param session: If not provided, a new session (connection pool) is created. To share a session across multiple clients, use :func:`create_session`. :type session: :class:`requests.sessions.Session` :param dict headers: Additional headers to add to requests. :param Optional[float] timeout: Maximum duration in seconds that client will wait for any single packet from the server. After the timeout the client will give up on connection. If `None`, client will wait forever. Defaults to 100 seconds. :param str oauth2_refresh_token: OAuth2 refresh token for refreshing access token :param datetime oauth2_access_token_expiration: Expiration for oauth2_access_token :param str app_key: application key of requesting application; used for token refresh :param str app_secret: application secret of requesting application; used for token refresh Not required if PKCE was used to authorize the token :param list scope: list of scopes to request on refresh. If left blank, refresh will request all available scopes for application :param str ca_certs: path to CA certificate. If left blank, default certificate location will be used
Creates a new copy of the Dropbox client with the same defaults unless modified by arguments to clone() See constructor for original parameter descriptions. :return: New instance of Dropbox client :rtype: Dropbox
Refreshes an access token via refresh token if available :param host: host to hit token endpoint with :param scope: list of permission scopes for access token :return:
Makes a request to the Dropbox API and in the process validates that the route argument and result are the expected data types. The request_arg is converted to JSON based on the arg_data_type. Likewise, the response is deserialized from JSON and converted to an object based on the {result,error}_data_type. :param host: The Dropbox API host to connect to. :param route: The route to make the request to. :type route: :class:`stone.backends.python_rsrc.stone_base.Route` :param request_arg: Argument for the route that conforms to the validator specified by route.arg_type. :param request_binary: String or file pointer representing the binary payload. Use None if there is no binary payload. :param Optional[float] timeout: Maximum duration in seconds that client will wait for any single packet from the server. After the timeout the client will give up on connection. If `None`, will use default timeout set on Dropbox object. Defaults to `None`. :return: The route's result.
Makes a request to the Dropbox API, taking a JSON-serializable Python object as an argument, and returning one as a response. :param host: The Dropbox API host to connect to. :param route_name: The name of the route to invoke. :param route_style: The style of the route. :param str request_arg: A JSON-serializable Python object representing the argument for the route. :param auth_type str :param Optional[bytes] request_binary: Bytes representing the binary payload. Use None if there is no binary payload. :param Optional[float] timeout: Maximum duration in seconds that client will wait for any single packet from the server. After the timeout the client will give up on connection. If `None`, will use default timeout set on Dropbox object. Defaults to `None`. :return: The route's result as a JSON-serializable Python object.
See :meth:`request_json_string_with_retry` for description of parameters.
See :meth:`request_json_object` for description of parameters. :param request_json_arg: A string representing the serialized JSON argument to the route.
Creates a clone of the Dropbox instance with the Dropbox-API-Path-Root header as the appropriate serialized instance of PathRoot. For more information, see https://www.dropbox.com/developers/reference/namespace-guide#pathrootmodes :param PathRoot path_root: instance of PathRoot to serialize into the headers field :return: A :class: `Dropbox` :rtype: Dropbox
Returns the URL of the route. :param str hostname: Hostname to make the request to. :param str route_name: Name of the route. :rtype: str