Skip to content

Commit

Permalink
Automated Spec Update (#448)
Browse files Browse the repository at this point in the history
18963b8a29fe125f6495d36c38eda5db2710d0dd

 Change Notes:

openid_openid_types Namespace
- Add OpenIdError, UserInfoError unions
- Remove UserInfoError structs
- Remove AuthError unions
- Update UserInfoArgs struct to include documentation

team_policies Namespace
- Add examples

Co-authored-by: Brent Bumann <bbumann@dropbox.com>

 c36ba27d8d56648555d3068bb3826e1d3a44d92b

 Co-authored-by: Bruce Zhang <brucez@dropbox.com>

Co-authored-by: DropboxBot <DropboxBot@users.noreply.github.com>
  • Loading branch information
DropboxBot and DropboxBot authored Oct 11, 2022
1 parent e1bee85 commit 93435f7
Show file tree
Hide file tree
Showing 9 changed files with 1,152 additions and 137 deletions.
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
120 changes: 120 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 Expand Up @@ -2559,6 +2562,123 @@ def team_reports_get_storage(self,
)
return r

def team_sharing_allowlist_add(self,
domains=None,
emails=None):
"""
Endpoint adds Approve List entries. Changes are effective immediately.
Changes are committed in transaction. In case of single validation error
- all entries are rejected. Valid domains (RFC-1034/5) and emails
(RFC-5322/822) are accepted. Added entries cannot overflow limit of
10000 entries per team. Maximum 100 entries per call is allowed.
Route attributes:
scope: team_info.write
:param Nullable[List[str]] domains: List of domains represented by valid
string representation (RFC-1034/5).
:param Nullable[List[str]] emails: List of emails represented by valid
string representation (RFC-5322/822).
:rtype: :class:`dropbox.team.SharingAllowlistAddResponse`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.SharingAllowlistAddError`
"""
arg = team.SharingAllowlistAddArgs(domains,
emails)
r = self.request(
team.sharing_allowlist_add,
'team',
arg,
None,
)
return r

def team_sharing_allowlist_list(self,
limit=1000):
"""
Lists Approve List entries for given team, from newest to oldest,
returning up to `limit` entries at a time. If there are more than
`limit` entries associated with the current team, more can be fetched by
passing the returned `cursor` to
:meth:`team_sharing_allowlist_list_continue`.
Route attributes:
scope: team_info.read
:param int limit: The number of entries to fetch at one time.
:rtype: :class:`dropbox.team.SharingAllowlistListResponse`
"""
arg = team.SharingAllowlistListArg(limit)
r = self.request(
team.sharing_allowlist_list,
'team',
arg,
None,
)
return r

def team_sharing_allowlist_list_continue(self,
cursor):
"""
Lists entries associated with given team, starting from a the cursor.
See :meth:`team_sharing_allowlist_list`.
Route attributes:
scope: team_info.read
:param str cursor: The cursor returned from a previous call to
:meth:`team_sharing_allowlist_list` or
:meth:`team_sharing_allowlist_list_continue`.
:rtype: :class:`dropbox.team.SharingAllowlistListResponse`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.SharingAllowlistListContinueError`
"""
arg = team.SharingAllowlistListContinueArg(cursor)
r = self.request(
team.sharing_allowlist_list_continue,
'team',
arg,
None,
)
return r

def team_sharing_allowlist_remove(self,
domains=None,
emails=None):
"""
Endpoint removes Approve List entries. Changes are effective
immediately. Changes are committed in transaction. In case of single
validation error - all entries are rejected. Valid domains (RFC-1034/5)
and emails (RFC-5322/822) are accepted. Entries being removed have to be
present on the list. Maximum 1000 entries per call is allowed.
Route attributes:
scope: team_info.write
:param Nullable[List[str]] domains: List of domains represented by valid
string representation (RFC-1034/5).
:param Nullable[List[str]] emails: List of emails represented by valid
string representation (RFC-5322/822).
:rtype: :class:`dropbox.team.SharingAllowlistRemoveResponse`
:raises: :class:`.exceptions.ApiError`
If this raises, ApiError will contain:
:class:`dropbox.team.SharingAllowlistRemoveError`
"""
arg = team.SharingAllowlistRemoveArgs(domains,
emails)
r = self.request(
team.sharing_allowlist_remove,
'team',
arg,
None,
)
return r

def team_team_folder_activate(self,
team_folder_id):
"""
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
Loading

0 comments on commit 93435f7

Please sign in to comment.