5353HTTP_STATUS_INVALID_PATH_ROOT = 422
5454TOKEN_EXPIRATION_BUFFER = 300
5555
56+ SELECT_ADMIN_HEADER = 'Dropbox-API-Select-Admin'
57+
58+ SELECT_USER_HEADER = 'Dropbox-API-Select-User'
59+
5660class RouteResult (object ):
5761 """The successful result of a call to a route."""
5862
@@ -652,10 +656,11 @@ def with_path_root(self, path_root):
652656 if not isinstance (path_root , PathRoot ):
653657 raise ValueError ("path_root must be an instance of PathRoot" )
654658
659+ new_headers = self ._headers .copy () if self ._headers else {}
660+ new_headers [PATH_ROOT_HEADER ] = stone_serializers .json_encode (PathRoot_validator , path_root )
661+
655662 return self .clone (
656- headers = {
657- PATH_ROOT_HEADER : stone_serializers .json_encode (PathRoot_validator , path_root )
658- }
663+ headers = new_headers
659664 )
660665
661666class Dropbox (_DropboxTransport , DropboxBase ):
@@ -682,7 +687,7 @@ def as_admin(self, team_member_id):
682687 of this admin of the team.
683688 :rtype: Dropbox
684689 """
685- return self ._get_dropbox_client_with_select_header ('Dropbox-API-Select-Admin' ,
690+ return self ._get_dropbox_client_with_select_header (SELECT_ADMIN_HEADER ,
686691 team_member_id )
687692
688693 def as_user (self , team_member_id ):
@@ -695,7 +700,7 @@ def as_user(self, team_member_id):
695700 of this member of the team.
696701 :rtype: Dropbox
697702 """
698- return self ._get_dropbox_client_with_select_header ('Dropbox-API-Select-User' ,
703+ return self ._get_dropbox_client_with_select_header (SELECT_USER_HEADER ,
699704 team_member_id )
700705
701706 def _get_dropbox_client_with_select_header (self , select_header_name , team_member_id ):
0 commit comments