Skip to content

Automated Spec Update #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions dropbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3065,7 +3065,8 @@ def files_tags_add(self,
scope: files.metadata.write

:param str path: Path to the item to be tagged.
:param str tag_text: The value of the tag to add.
:param str tag_text: The value of the tag to add. Will be automatically
converted to lowercase letters.
:rtype: None
:raises: :class:`.exceptions.ApiError`

Expand Down Expand Up @@ -3116,7 +3117,8 @@ def files_tags_remove(self,
scope: files.metadata.write

:param str path: Path to the item to tag.
:param str tag_text: The tag to remove.
:param str tag_text: The tag to remove. Will be automatically converted
to lowercase letters.
:rtype: None
:raises: :class:`.exceptions.ApiError`

Expand Down Expand Up @@ -3559,6 +3561,33 @@ def files_upload_session_start_batch(self,
)
return r

# ------------------------------------------
# Routes in openid namespace

def openid_userinfo(self):
"""
This route is used for refreshing the info that is found in the id_token
during the OIDC flow. This route doesn't require any arguments and will
use the scopes approved for the given access token.

Route attributes:
scope: openid

:rtype: :class:`dropbox.openid.UserInfoResult`
:raises: :class:`.exceptions.ApiError`

If this raises, ApiError will contain:
:class:`dropbox.openid.UserInfoError`
"""
arg = openid.UserInfoArgs()
r = self.request(
openid.userinfo,
'openid',
arg,
None,
)
return r

# ------------------------------------------
# Routes in paper namespace

Expand Down
3 changes: 3 additions & 0 deletions dropbox/base_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ def file_properties_templates_update_for_team(self,
# ------------------------------------------
# Routes in files namespace

# ------------------------------------------
# Routes in openid namespace

# ------------------------------------------
# Routes in paper namespace

Expand Down
6 changes: 4 additions & 2 deletions dropbox/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
class AddTagArg(bb.Struct):
"""
:ivar files.AddTagArg.path: Path to the item to be tagged.
:ivar files.AddTagArg.tag_text: The value of the tag to add.
:ivar files.AddTagArg.tag_text: The value of the tag to add. Will be
automatically converted to lowercase letters.
"""

__slots__ = [
Expand Down Expand Up @@ -6858,7 +6859,8 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
class RemoveTagArg(bb.Struct):
"""
:ivar files.RemoveTagArg.path: Path to the item to tag.
:ivar files.RemoveTagArg.tag_text: The tag to remove.
:ivar files.RemoveTagArg.tag_text: The tag to remove. Will be automatically
converted to lowercase letters.
"""

__slots__ = [
Expand Down
26 changes: 26 additions & 0 deletions dropbox/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
UserInfoArgs_validator = bv.Struct(UserInfoArgs)

class UserInfoError(bb.Struct):
"""
:ivar openid.UserInfoError.error_message: Brief explanation of the error.
"""

__slots__ = [
'_err_value',
Expand Down Expand Up @@ -101,6 +104,16 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
UserInfoError_validator = bv.Struct(UserInfoError)

class UserInfoResult(bb.Struct):
"""
:ivar openid.UserInfoResult.family_name: Last name of user.
:ivar openid.UserInfoResult.given_name: First name of user.
:ivar openid.UserInfoResult.email: Email address of user.
:ivar openid.UserInfoResult.email_verified: If user is email verified.
:ivar openid.UserInfoResult.iss: Issuer of token (in this case Dropbox).
:ivar openid.UserInfoResult.sub: An identifier for the user. This is the
Dropbox account_id, a string value such as
dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc.
"""

__slots__ = [
'_family_name_value',
Expand Down Expand Up @@ -277,6 +290,19 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
UserInfoError.error_message.default = ''
UserInfoResult.iss.default = ''
UserInfoResult.sub.default = ''
userinfo = bb.Route(
'userinfo',
1,
False,
UserInfoArgs_validator,
UserInfoResult_validator,
UserInfoError_validator,
{'auth': 'user',
'host': 'api',
'style': 'rpc'},
)

ROUTES = {
'userinfo': userinfo,
}

12 changes: 9 additions & 3 deletions dropbox/sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2264,8 +2264,11 @@ class FileMemberActionIndividualResult(bb.Union):
corresponding ``get_*`` method.

:ivar Optional[AccessLevel]
sharing.FileMemberActionIndividualResult.success: Member was
successfully removed from this file. If AccessLevel is given, the member
sharing.FileMemberActionIndividualResult.success: Part of the response
for both add_file_member and remove_file_member_v1 (deprecated). For
add_file_member, indicates giving access was successful and at what
AccessLevel. For remove_file_member_v1, indicates member was
successfully removed from the file. If AccessLevel is given, the member
still has access via a parent shared folder.
:ivar FileMemberActionError FileMemberActionIndividualResult.member_error:
User was not able to perform this action.
Expand Down Expand Up @@ -2313,7 +2316,10 @@ def is_member_error(self):

def get_success(self):
"""
Member was successfully removed from this file. If AccessLevel is given,
Part of the response for both add_file_member and remove_file_member_v1
(deprecated). For add_file_member, indicates giving access was
successful and at what AccessLevel. For remove_file_member_v1, indicates
member was successfully removed from the file. If AccessLevel is given,
the member still has access via a parent shared folder.

Only call this if :meth:`is_success` is true.
Expand Down
Loading