Skip to content

Commit 93435f7

Browse files
authored
Automated Spec Update (#448)
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>
1 parent e1bee85 commit 93435f7

File tree

9 files changed

+1152
-137
lines changed

9 files changed

+1152
-137
lines changed

dropbox/base.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,7 +3065,8 @@ def files_tags_add(self,
30653065
scope: files.metadata.write
30663066
30673067
:param str path: Path to the item to be tagged.
3068-
:param str tag_text: The value of the tag to add.
3068+
:param str tag_text: The value of the tag to add. Will be automatically
3069+
converted to lowercase letters.
30693070
:rtype: None
30703071
:raises: :class:`.exceptions.ApiError`
30713072
@@ -3116,7 +3117,8 @@ def files_tags_remove(self,
31163117
scope: files.metadata.write
31173118
31183119
:param str path: Path to the item to tag.
3119-
:param str tag_text: The tag to remove.
3120+
:param str tag_text: The tag to remove. Will be automatically converted
3121+
to lowercase letters.
31203122
:rtype: None
31213123
:raises: :class:`.exceptions.ApiError`
31223124
@@ -3559,6 +3561,33 @@ def files_upload_session_start_batch(self,
35593561
)
35603562
return r
35613563

3564+
# ------------------------------------------
3565+
# Routes in openid namespace
3566+
3567+
def openid_userinfo(self):
3568+
"""
3569+
This route is used for refreshing the info that is found in the id_token
3570+
during the OIDC flow. This route doesn't require any arguments and will
3571+
use the scopes approved for the given access token.
3572+
3573+
Route attributes:
3574+
scope: openid
3575+
3576+
:rtype: :class:`dropbox.openid.UserInfoResult`
3577+
:raises: :class:`.exceptions.ApiError`
3578+
3579+
If this raises, ApiError will contain:
3580+
:class:`dropbox.openid.UserInfoError`
3581+
"""
3582+
arg = openid.UserInfoArgs()
3583+
r = self.request(
3584+
openid.userinfo,
3585+
'openid',
3586+
arg,
3587+
None,
3588+
)
3589+
return r
3590+
35623591
# ------------------------------------------
35633592
# Routes in paper namespace
35643593

dropbox/base_team.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ def file_properties_templates_update_for_team(self,
205205
# ------------------------------------------
206206
# Routes in files namespace
207207

208+
# ------------------------------------------
209+
# Routes in openid namespace
210+
208211
# ------------------------------------------
209212
# Routes in paper namespace
210213

@@ -2559,6 +2562,123 @@ def team_reports_get_storage(self,
25592562
)
25602563
return r
25612564

2565+
def team_sharing_allowlist_add(self,
2566+
domains=None,
2567+
emails=None):
2568+
"""
2569+
Endpoint adds Approve List entries. Changes are effective immediately.
2570+
Changes are committed in transaction. In case of single validation error
2571+
- all entries are rejected. Valid domains (RFC-1034/5) and emails
2572+
(RFC-5322/822) are accepted. Added entries cannot overflow limit of
2573+
10000 entries per team. Maximum 100 entries per call is allowed.
2574+
2575+
Route attributes:
2576+
scope: team_info.write
2577+
2578+
:param Nullable[List[str]] domains: List of domains represented by valid
2579+
string representation (RFC-1034/5).
2580+
:param Nullable[List[str]] emails: List of emails represented by valid
2581+
string representation (RFC-5322/822).
2582+
:rtype: :class:`dropbox.team.SharingAllowlistAddResponse`
2583+
:raises: :class:`.exceptions.ApiError`
2584+
2585+
If this raises, ApiError will contain:
2586+
:class:`dropbox.team.SharingAllowlistAddError`
2587+
"""
2588+
arg = team.SharingAllowlistAddArgs(domains,
2589+
emails)
2590+
r = self.request(
2591+
team.sharing_allowlist_add,
2592+
'team',
2593+
arg,
2594+
None,
2595+
)
2596+
return r
2597+
2598+
def team_sharing_allowlist_list(self,
2599+
limit=1000):
2600+
"""
2601+
Lists Approve List entries for given team, from newest to oldest,
2602+
returning up to `limit` entries at a time. If there are more than
2603+
`limit` entries associated with the current team, more can be fetched by
2604+
passing the returned `cursor` to
2605+
:meth:`team_sharing_allowlist_list_continue`.
2606+
2607+
Route attributes:
2608+
scope: team_info.read
2609+
2610+
:param int limit: The number of entries to fetch at one time.
2611+
:rtype: :class:`dropbox.team.SharingAllowlistListResponse`
2612+
"""
2613+
arg = team.SharingAllowlistListArg(limit)
2614+
r = self.request(
2615+
team.sharing_allowlist_list,
2616+
'team',
2617+
arg,
2618+
None,
2619+
)
2620+
return r
2621+
2622+
def team_sharing_allowlist_list_continue(self,
2623+
cursor):
2624+
"""
2625+
Lists entries associated with given team, starting from a the cursor.
2626+
See :meth:`team_sharing_allowlist_list`.
2627+
2628+
Route attributes:
2629+
scope: team_info.read
2630+
2631+
:param str cursor: The cursor returned from a previous call to
2632+
:meth:`team_sharing_allowlist_list` or
2633+
:meth:`team_sharing_allowlist_list_continue`.
2634+
:rtype: :class:`dropbox.team.SharingAllowlistListResponse`
2635+
:raises: :class:`.exceptions.ApiError`
2636+
2637+
If this raises, ApiError will contain:
2638+
:class:`dropbox.team.SharingAllowlistListContinueError`
2639+
"""
2640+
arg = team.SharingAllowlistListContinueArg(cursor)
2641+
r = self.request(
2642+
team.sharing_allowlist_list_continue,
2643+
'team',
2644+
arg,
2645+
None,
2646+
)
2647+
return r
2648+
2649+
def team_sharing_allowlist_remove(self,
2650+
domains=None,
2651+
emails=None):
2652+
"""
2653+
Endpoint removes Approve List entries. Changes are effective
2654+
immediately. Changes are committed in transaction. In case of single
2655+
validation error - all entries are rejected. Valid domains (RFC-1034/5)
2656+
and emails (RFC-5322/822) are accepted. Entries being removed have to be
2657+
present on the list. Maximum 1000 entries per call is allowed.
2658+
2659+
Route attributes:
2660+
scope: team_info.write
2661+
2662+
:param Nullable[List[str]] domains: List of domains represented by valid
2663+
string representation (RFC-1034/5).
2664+
:param Nullable[List[str]] emails: List of emails represented by valid
2665+
string representation (RFC-5322/822).
2666+
:rtype: :class:`dropbox.team.SharingAllowlistRemoveResponse`
2667+
:raises: :class:`.exceptions.ApiError`
2668+
2669+
If this raises, ApiError will contain:
2670+
:class:`dropbox.team.SharingAllowlistRemoveError`
2671+
"""
2672+
arg = team.SharingAllowlistRemoveArgs(domains,
2673+
emails)
2674+
r = self.request(
2675+
team.sharing_allowlist_remove,
2676+
'team',
2677+
arg,
2678+
None,
2679+
)
2680+
return r
2681+
25622682
def team_team_folder_activate(self,
25632683
team_folder_id):
25642684
"""

dropbox/files.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
class AddTagArg(bb.Struct):
2020
"""
2121
:ivar files.AddTagArg.path: Path to the item to be tagged.
22-
:ivar files.AddTagArg.tag_text: The value of the tag to add.
22+
:ivar files.AddTagArg.tag_text: The value of the tag to add. Will be
23+
automatically converted to lowercase letters.
2324
"""
2425

2526
__slots__ = [
@@ -6858,7 +6859,8 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
68586859
class RemoveTagArg(bb.Struct):
68596860
"""
68606861
:ivar files.RemoveTagArg.path: Path to the item to tag.
6861-
:ivar files.RemoveTagArg.tag_text: The tag to remove.
6862+
:ivar files.RemoveTagArg.tag_text: The tag to remove. Will be automatically
6863+
converted to lowercase letters.
68626864
"""
68636865

68646866
__slots__ = [

0 commit comments

Comments
 (0)