diff --git a/dropbox/base.py b/dropbox/base.py index 6e2cbf59..c91ed484 100644 --- a/dropbox/base.py +++ b/dropbox/base.py @@ -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` @@ -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` @@ -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 diff --git a/dropbox/base_team.py b/dropbox/base_team.py index 8b822d58..3b7b86e9 100644 --- a/dropbox/base_team.py +++ b/dropbox/base_team.py @@ -205,6 +205,9 @@ def file_properties_templates_update_for_team(self, # ------------------------------------------ # Routes in files namespace + # ------------------------------------------ + # Routes in openid namespace + # ------------------------------------------ # Routes in paper namespace diff --git a/dropbox/files.py b/dropbox/files.py index ecdcba46..10727c8a 100644 --- a/dropbox/files.py +++ b/dropbox/files.py @@ -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__ = [ @@ -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__ = [ diff --git a/dropbox/openid.py b/dropbox/openid.py index 6e6f25e7..31767899 100644 --- a/dropbox/openid.py +++ b/dropbox/openid.py @@ -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', @@ -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', @@ -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, } diff --git a/dropbox/sharing.py b/dropbox/sharing.py index 37547b6c..d66215bc 100644 --- a/dropbox/sharing.py +++ b/dropbox/sharing.py @@ -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. @@ -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. diff --git a/dropbox/team_log.py b/dropbox/team_log.py index 11c4feef..e30ecaaf 100644 --- a/dropbox/team_log.py +++ b/dropbox/team_log.py @@ -1864,7 +1864,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): class AdminEmailRemindersChangedDetails(bb.Struct): """ - Changed admin email reminder policy for team requests to join. + Changed admin reminder settings for requests to join the team. :ivar team_log.AdminEmailRemindersChangedDetails.new_value: To. :ivar team_log.AdminEmailRemindersChangedDetails.previous_value: From. @@ -12619,6 +12619,18 @@ def file_locking_policy_changed_details(cls, val): """ return cls('file_locking_policy_changed_details', val) + @classmethod + def file_provider_migration_policy_changed_details(cls, val): + """ + Create an instance of this class set to the + ``file_provider_migration_policy_changed_details`` tag with value + ``val``. + + :param FileProviderMigrationPolicyChangedDetails val: + :rtype: EventDetails + """ + return cls('file_provider_migration_policy_changed_details', val) + @classmethod def file_requests_change_policy_details(cls, val): """ @@ -16817,6 +16829,14 @@ def is_file_locking_policy_changed_details(self): """ return self._tag == 'file_locking_policy_changed_details' + def is_file_provider_migration_policy_changed_details(self): + """ + Check if the union tag is ``file_provider_migration_policy_changed_details``. + + :rtype: bool + """ + return self._tag == 'file_provider_migration_policy_changed_details' + def is_file_requests_change_policy_details(self): """ Check if the union tag is ``file_requests_change_policy_details``. @@ -21451,6 +21471,16 @@ def get_file_locking_policy_changed_details(self): raise AttributeError("tag 'file_locking_policy_changed_details' not set") return self._value + def get_file_provider_migration_policy_changed_details(self): + """ + Only call this if :meth:`is_file_provider_migration_policy_changed_details` is true. + + :rtype: FileProviderMigrationPolicyChangedDetails + """ + if not self.is_file_provider_migration_policy_changed_details(): + raise AttributeError("tag 'file_provider_migration_policy_changed_details' not set") + return self._value + def get_file_requests_change_policy_details(self): """ Only call this if :meth:`is_file_requests_change_policy_details` is true. @@ -23304,7 +23334,7 @@ class EventType(bb.Union): capture setting on team domain :ivar AdminEmailRemindersChangedType EventType.admin_email_reminders_changed: (team_policies) Changed admin - email reminder policy for team requests to join + reminder settings for requests to join the team :ivar AllowDownloadDisabledType EventType.allow_download_disabled: (team_policies) Disabled downloads (deprecated, no longer logged) :ivar AllowDownloadEnabledType EventType.allow_download_enabled: @@ -23378,6 +23408,9 @@ class EventType(bb.Union): (team_policies) Enabled/disabled commenting on team files :ivar FileLockingPolicyChangedType EventType.file_locking_policy_changed: (team_policies) Changed file locking policy for team + :ivar FileProviderMigrationPolicyChangedType + EventType.file_provider_migration_policy_changed: (team_policies) + Changed File Provider Migration policy for team :ivar FileRequestsChangePolicyType EventType.file_requests_change_policy: (team_policies) Enabled/disabled file requests :ivar FileRequestsEmailsEnabledType EventType.file_requests_emails_enabled: @@ -27863,6 +27896,17 @@ def file_locking_policy_changed(cls, val): """ return cls('file_locking_policy_changed', val) + @classmethod + def file_provider_migration_policy_changed(cls, val): + """ + Create an instance of this class set to the + ``file_provider_migration_policy_changed`` tag with value ``val``. + + :param FileProviderMigrationPolicyChangedType val: + :rtype: EventType + """ + return cls('file_provider_migration_policy_changed', val) + @classmethod def file_requests_change_policy(cls, val): """ @@ -32037,6 +32081,14 @@ def is_file_locking_policy_changed(self): """ return self._tag == 'file_locking_policy_changed' + def is_file_provider_migration_policy_changed(self): + """ + Check if the union tag is ``file_provider_migration_policy_changed``. + + :rtype: bool + """ + return self._tag == 'file_provider_migration_policy_changed' + def is_file_requests_change_policy(self): """ Check if the union tag is ``file_requests_change_policy``. @@ -37135,8 +37187,8 @@ def get_account_capture_change_policy(self): def get_admin_email_reminders_changed(self): """ - (team_policies) Changed admin email reminder policy for team requests to - join + (team_policies) Changed admin reminder settings for requests to join the + team Only call this if :meth:`is_admin_email_reminders_changed` is true. @@ -37477,6 +37529,18 @@ def get_file_locking_policy_changed(self): raise AttributeError("tag 'file_locking_policy_changed' not set") return self._value + def get_file_provider_migration_policy_changed(self): + """ + (team_policies) Changed File Provider Migration policy for team + + Only call this if :meth:`is_file_provider_migration_policy_changed` is true. + + :rtype: FileProviderMigrationPolicyChangedType + """ + if not self.is_file_provider_migration_policy_changed(): + raise AttributeError("tag 'file_provider_migration_policy_changed' not set") + return self._value + def get_file_requests_change_policy(self): """ (team_policies) Enabled/disabled file requests @@ -39433,7 +39497,7 @@ class EventTypeArg(bb.Union): :ivar team_log.EventTypeArg.account_capture_change_policy: (team_policies) Changed account capture setting on team domain :ivar team_log.EventTypeArg.admin_email_reminders_changed: (team_policies) - Changed admin email reminder policy for team requests to join + Changed admin reminder settings for requests to join the team :ivar team_log.EventTypeArg.allow_download_disabled: (team_policies) Disabled downloads (deprecated, no longer logged) :ivar team_log.EventTypeArg.allow_download_enabled: (team_policies) Enabled @@ -39494,6 +39558,8 @@ class EventTypeArg(bb.Union): Enabled/disabled commenting on team files :ivar team_log.EventTypeArg.file_locking_policy_changed: (team_policies) Changed file locking policy for team + :ivar team_log.EventTypeArg.file_provider_migration_policy_changed: + (team_policies) Changed File Provider Migration policy for team :ivar team_log.EventTypeArg.file_requests_change_policy: (team_policies) Enabled/disabled file requests :ivar team_log.EventTypeArg.file_requests_emails_enabled: (team_policies) @@ -40499,6 +40565,8 @@ class EventTypeArg(bb.Union): # Attribute is overwritten below the class definition file_locking_policy_changed = None # Attribute is overwritten below the class definition + file_provider_migration_policy_changed = None + # Attribute is overwritten below the class definition file_requests_change_policy = None # Attribute is overwritten below the class definition file_requests_emails_enabled = None @@ -43751,6 +43819,14 @@ def is_file_locking_policy_changed(self): """ return self._tag == 'file_locking_policy_changed' + def is_file_provider_migration_policy_changed(self): + """ + Check if the union tag is ``file_provider_migration_policy_changed``. + + :rtype: bool + """ + return self._tag == 'file_provider_migration_policy_changed' + def is_file_requests_change_policy(self): """ Check if the union tag is ``file_requests_change_policy``. @@ -46690,6 +46766,65 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): FilePreviewType_validator = bv.Struct(FilePreviewType) +class FileProviderMigrationPolicyChangedDetails(bb.Struct): + """ + Changed File Provider Migration policy for team. + + :ivar team_log.FileProviderMigrationPolicyChangedDetails.new_value: To. + :ivar team_log.FileProviderMigrationPolicyChangedDetails.previous_value: + From. + """ + + __slots__ = [ + '_new_value_value', + '_previous_value_value', + ] + + _has_required_fields = True + + def __init__(self, + new_value=None, + previous_value=None): + self._new_value_value = bb.NOT_SET + self._previous_value_value = bb.NOT_SET + if new_value is not None: + self.new_value = new_value + if previous_value is not None: + self.previous_value = previous_value + + # Instance attribute type: team_policies.FileProviderMigrationPolicyState (validator is set below) + new_value = bb.Attribute("new_value", user_defined=True) + + # Instance attribute type: team_policies.FileProviderMigrationPolicyState (validator is set below) + previous_value = bb.Attribute("previous_value", user_defined=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(FileProviderMigrationPolicyChangedDetails, self)._process_custom_annotations(annotation_type, field_path, processor) + +FileProviderMigrationPolicyChangedDetails_validator = bv.Struct(FileProviderMigrationPolicyChangedDetails) + +class FileProviderMigrationPolicyChangedType(bb.Struct): + + __slots__ = [ + '_description_value', + ] + + _has_required_fields = True + + def __init__(self, + description=None): + self._description_value = bb.NOT_SET + if description is not None: + self.description = description + + # Instance attribute type: str (validator is set below) + description = bb.Attribute("description") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(FileProviderMigrationPolicyChangedType, self)._process_custom_annotations(annotation_type, field_path, processor) + +FileProviderMigrationPolicyChangedType_validator = bv.Struct(FileProviderMigrationPolicyChangedType) + class FileRenameDetails(bb.Struct): """ Renamed files and/or folders. @@ -69188,6 +69323,8 @@ class TeamMembershipType(bb.Union): # Attribute is overwritten below the class definition full = None # Attribute is overwritten below the class definition + guest = None + # Attribute is overwritten below the class definition other = None def is_free(self): @@ -69206,6 +69343,14 @@ def is_full(self): """ return self._tag == 'full' + def is_guest(self): + """ + Check if the union tag is ``guest``. + + :rtype: bool + """ + return self._tag == 'guest' + def is_other(self): """ Check if the union tag is ``other``. @@ -75420,6 +75565,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventDetails._external_drive_backup_policy_changed_details_validator = ExternalDriveBackupPolicyChangedDetails_validator EventDetails._file_comments_change_policy_details_validator = FileCommentsChangePolicyDetails_validator EventDetails._file_locking_policy_changed_details_validator = FileLockingPolicyChangedDetails_validator +EventDetails._file_provider_migration_policy_changed_details_validator = FileProviderMigrationPolicyChangedDetails_validator EventDetails._file_requests_change_policy_details_validator = FileRequestsChangePolicyDetails_validator EventDetails._file_requests_emails_enabled_details_validator = FileRequestsEmailsEnabledDetails_validator EventDetails._file_requests_emails_restricted_to_team_only_details_validator = FileRequestsEmailsRestrictedToTeamOnlyDetails_validator @@ -75905,6 +76051,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): 'external_drive_backup_policy_changed_details': EventDetails._external_drive_backup_policy_changed_details_validator, 'file_comments_change_policy_details': EventDetails._file_comments_change_policy_details_validator, 'file_locking_policy_changed_details': EventDetails._file_locking_policy_changed_details_validator, + 'file_provider_migration_policy_changed_details': EventDetails._file_provider_migration_policy_changed_details_validator, 'file_requests_change_policy_details': EventDetails._file_requests_change_policy_details_validator, 'file_requests_emails_enabled_details': EventDetails._file_requests_emails_enabled_details_validator, 'file_requests_emails_restricted_to_team_only_details': EventDetails._file_requests_emails_restricted_to_team_only_details_validator, @@ -76393,6 +76540,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventType._external_drive_backup_policy_changed_validator = ExternalDriveBackupPolicyChangedType_validator EventType._file_comments_change_policy_validator = FileCommentsChangePolicyType_validator EventType._file_locking_policy_changed_validator = FileLockingPolicyChangedType_validator +EventType._file_provider_migration_policy_changed_validator = FileProviderMigrationPolicyChangedType_validator EventType._file_requests_change_policy_validator = FileRequestsChangePolicyType_validator EventType._file_requests_emails_enabled_validator = FileRequestsEmailsEnabledType_validator EventType._file_requests_emails_restricted_to_team_only_validator = FileRequestsEmailsRestrictedToTeamOnlyType_validator @@ -76877,6 +77025,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): 'external_drive_backup_policy_changed': EventType._external_drive_backup_policy_changed_validator, 'file_comments_change_policy': EventType._file_comments_change_policy_validator, 'file_locking_policy_changed': EventType._file_locking_policy_changed_validator, + 'file_provider_migration_policy_changed': EventType._file_provider_migration_policy_changed_validator, 'file_requests_change_policy': EventType._file_requests_change_policy_validator, 'file_requests_emails_enabled': EventType._file_requests_emails_enabled_validator, 'file_requests_emails_restricted_to_team_only': EventType._file_requests_emails_restricted_to_team_only_validator, @@ -77364,6 +77513,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventTypeArg._external_drive_backup_policy_changed_validator = bv.Void() EventTypeArg._file_comments_change_policy_validator = bv.Void() EventTypeArg._file_locking_policy_changed_validator = bv.Void() +EventTypeArg._file_provider_migration_policy_changed_validator = bv.Void() EventTypeArg._file_requests_change_policy_validator = bv.Void() EventTypeArg._file_requests_emails_enabled_validator = bv.Void() EventTypeArg._file_requests_emails_restricted_to_team_only_validator = bv.Void() @@ -77848,6 +77998,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): 'external_drive_backup_policy_changed': EventTypeArg._external_drive_backup_policy_changed_validator, 'file_comments_change_policy': EventTypeArg._file_comments_change_policy_validator, 'file_locking_policy_changed': EventTypeArg._file_locking_policy_changed_validator, + 'file_provider_migration_policy_changed': EventTypeArg._file_provider_migration_policy_changed_validator, 'file_requests_change_policy': EventTypeArg._file_requests_change_policy_validator, 'file_requests_emails_enabled': EventTypeArg._file_requests_emails_enabled_validator, 'file_requests_emails_restricted_to_team_only': EventTypeArg._file_requests_emails_restricted_to_team_only_validator, @@ -78333,6 +78484,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventTypeArg.external_drive_backup_policy_changed = EventTypeArg('external_drive_backup_policy_changed') EventTypeArg.file_comments_change_policy = EventTypeArg('file_comments_change_policy') EventTypeArg.file_locking_policy_changed = EventTypeArg('file_locking_policy_changed') +EventTypeArg.file_provider_migration_policy_changed = EventTypeArg('file_provider_migration_policy_changed') EventTypeArg.file_requests_change_policy = EventTypeArg('file_requests_change_policy') EventTypeArg.file_requests_emails_enabled = EventTypeArg('file_requests_emails_enabled') EventTypeArg.file_requests_emails_restricted_to_team_only = EventTypeArg('file_requests_emails_restricted_to_team_only') @@ -78899,6 +79051,21 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): FilePreviewType._all_field_names_ = set(['description']) FilePreviewType._all_fields_ = [('description', FilePreviewType.description.validator)] +FileProviderMigrationPolicyChangedDetails.new_value.validator = team_policies.FileProviderMigrationPolicyState_validator +FileProviderMigrationPolicyChangedDetails.previous_value.validator = team_policies.FileProviderMigrationPolicyState_validator +FileProviderMigrationPolicyChangedDetails._all_field_names_ = set([ + 'new_value', + 'previous_value', +]) +FileProviderMigrationPolicyChangedDetails._all_fields_ = [ + ('new_value', FileProviderMigrationPolicyChangedDetails.new_value.validator), + ('previous_value', FileProviderMigrationPolicyChangedDetails.previous_value.validator), +] + +FileProviderMigrationPolicyChangedType.description.validator = bv.String() +FileProviderMigrationPolicyChangedType._all_field_names_ = set(['description']) +FileProviderMigrationPolicyChangedType._all_fields_ = [('description', FileProviderMigrationPolicyChangedType.description.validator)] + FileRenameDetails.relocate_action_details.validator = bv.List(RelocateAssetReferencesLogInfo_validator) FileRenameDetails._all_field_names_ = set(['relocate_action_details']) FileRenameDetails._all_fields_ = [('relocate_action_details', FileRenameDetails.relocate_action_details.validator)] @@ -84046,15 +84213,18 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): TeamMembershipType._free_validator = bv.Void() TeamMembershipType._full_validator = bv.Void() +TeamMembershipType._guest_validator = bv.Void() TeamMembershipType._other_validator = bv.Void() TeamMembershipType._tagmap = { 'free': TeamMembershipType._free_validator, 'full': TeamMembershipType._full_validator, + 'guest': TeamMembershipType._guest_validator, 'other': TeamMembershipType._other_validator, } TeamMembershipType.free = TeamMembershipType('free') TeamMembershipType.full = TeamMembershipType('full') +TeamMembershipType.guest = TeamMembershipType('guest') TeamMembershipType.other = TeamMembershipType('other') TeamMergeFromDetails.team_name.validator = bv.String() diff --git a/spec b/spec index f91238c7..c36ba27d 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit f91238c7508770245030a449d86bd698d30ebfc3 +Subproject commit c36ba27d8d56648555d3068bb3826e1d3a44d92b