From 43aba2829cbef669f8825bbc187b141592fe65f5 Mon Sep 17 00:00:00 2001 From: DropboxBot Date: Wed, 13 Jul 2022 17:51:00 +0000 Subject: [PATCH] Automated Spec Update f91238c7508770245030a449d86bd698d30ebfc3 Change Notes: check_api_v2_types Namespace - Update EchoArg struct to include max_length in query arg sharing_files Namespace - Update FileMemberActionResult to include sckey_sha1, invitation_signature team_log_generated Namespace - Add AdminEmailRemindersChangedDetails, AdminEmailRemindersChangedType structs - Add AdminEmailRemindersPolicy unions team_policies Namespace - Add AdminEmailRemindersChangedType struct - Add FileProviderMigrationPolicyState unions Co-authored-by: Brent Bumann --- dropbox/base.py | 1 + dropbox/base_team.py | 1 + dropbox/check.py | 2 +- dropbox/openid.py | 282 +++++++++++++++++++++++++++++++++++++++ dropbox/sharing.py | 30 ++++- dropbox/team_log.py | 229 +++++++++++++++++++++++++++++++ dropbox/team_policies.py | 77 +++++++++++ spec | 2 +- 8 files changed, 621 insertions(+), 3 deletions(-) create mode 100644 dropbox/openid.py diff --git a/dropbox/base.py b/dropbox/base.py index 73b7307b..6e2cbf59 100644 --- a/dropbox/base.py +++ b/dropbox/base.py @@ -15,6 +15,7 @@ from dropbox import file_properties from dropbox import file_requests from dropbox import files +from dropbox import openid from dropbox import paper from dropbox import secondary_emails from dropbox import seen_state diff --git a/dropbox/base_team.py b/dropbox/base_team.py index 4986e47f..8b822d58 100644 --- a/dropbox/base_team.py +++ b/dropbox/base_team.py @@ -15,6 +15,7 @@ from dropbox import file_properties from dropbox import file_requests from dropbox import files +from dropbox import openid from dropbox import paper from dropbox import secondary_emails from dropbox import seen_state diff --git a/dropbox/check.py b/dropbox/check.py index 8fc2ed43..29d85034 100644 --- a/dropbox/check.py +++ b/dropbox/check.py @@ -63,7 +63,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EchoResult_validator = bv.Struct(EchoResult) -EchoArg.query.validator = bv.String() +EchoArg.query.validator = bv.String(max_length=500) EchoArg._all_field_names_ = set(['query']) EchoArg._all_fields_ = [('query', EchoArg.query.validator)] diff --git a/dropbox/openid.py b/dropbox/openid.py new file mode 100644 index 00000000..6e6f25e7 --- /dev/null +++ b/dropbox/openid.py @@ -0,0 +1,282 @@ +# -*- coding: utf-8 -*- +# Auto-generated by Stone, do not modify. +# @generated +# flake8: noqa +# pylint: skip-file +from __future__ import unicode_literals +from stone.backends.python_rsrc import stone_base as bb +from stone.backends.python_rsrc import stone_validators as bv + +class AuthError(bb.Union): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + _catch_all = 'other' + # Attribute is overwritten below the class definition + invalid_token = None + # Attribute is overwritten below the class definition + no_openid_auth = None + # Attribute is overwritten below the class definition + other = None + + def is_invalid_token(self): + """ + Check if the union tag is ``invalid_token``. + + :rtype: bool + """ + return self._tag == 'invalid_token' + + def is_no_openid_auth(self): + """ + Check if the union tag is ``no_openid_auth``. + + :rtype: bool + """ + return self._tag == 'no_openid_auth' + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == 'other' + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(AuthError, self)._process_custom_annotations(annotation_type, field_path, processor) + +AuthError_validator = bv.Union(AuthError) + +class UserInfoArgs(bb.Struct): + """ + This struct is empty. The comment here is intentionally emitted to avoid + indentation issues with Stone. + """ + + __slots__ = [ + ] + + _has_required_fields = False + + def __init__(self): + pass + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(UserInfoArgs, self)._process_custom_annotations(annotation_type, field_path, processor) + +UserInfoArgs_validator = bv.Struct(UserInfoArgs) + +class UserInfoError(bb.Struct): + + __slots__ = [ + '_err_value', + '_error_message_value', + ] + + _has_required_fields = False + + def __init__(self, + err=None, + error_message=None): + self._err_value = bb.NOT_SET + self._error_message_value = bb.NOT_SET + if err is not None: + self.err = err + if error_message is not None: + self.error_message = error_message + + # Instance attribute type: ErrUnion (validator is set below) + err = bb.Attribute("err", nullable=True, user_defined=True) + + # Instance attribute type: str (validator is set below) + error_message = bb.Attribute("error_message") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(UserInfoError, self)._process_custom_annotations(annotation_type, field_path, processor) + +UserInfoError_validator = bv.Struct(UserInfoError) + +class UserInfoResult(bb.Struct): + + __slots__ = [ + '_family_name_value', + '_given_name_value', + '_email_value', + '_email_verified_value', + '_iss_value', + '_sub_value', + ] + + _has_required_fields = False + + def __init__(self, + family_name=None, + given_name=None, + email=None, + email_verified=None, + iss=None, + sub=None): + self._family_name_value = bb.NOT_SET + self._given_name_value = bb.NOT_SET + self._email_value = bb.NOT_SET + self._email_verified_value = bb.NOT_SET + self._iss_value = bb.NOT_SET + self._sub_value = bb.NOT_SET + if family_name is not None: + self.family_name = family_name + if given_name is not None: + self.given_name = given_name + if email is not None: + self.email = email + if email_verified is not None: + self.email_verified = email_verified + if iss is not None: + self.iss = iss + if sub is not None: + self.sub = sub + + # Instance attribute type: str (validator is set below) + family_name = bb.Attribute("family_name", nullable=True) + + # Instance attribute type: str (validator is set below) + given_name = bb.Attribute("given_name", nullable=True) + + # Instance attribute type: str (validator is set below) + email = bb.Attribute("email", nullable=True) + + # Instance attribute type: bool (validator is set below) + email_verified = bb.Attribute("email_verified", nullable=True) + + # Instance attribute type: str (validator is set below) + iss = bb.Attribute("iss") + + # Instance attribute type: str (validator is set below) + sub = bb.Attribute("sub") + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(UserInfoResult, self)._process_custom_annotations(annotation_type, field_path, processor) + +UserInfoResult_validator = bv.Struct(UserInfoResult) + +class ErrUnion(bb.Union): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + _catch_all = 'other' + # Attribute is overwritten below the class definition + other = None + + @classmethod + def auth_error(cls, val): + """ + Create an instance of this class set to the ``auth_error`` tag with + value ``val``. + + :param AuthError val: + :rtype: ErrUnion + """ + return cls('auth_error', val) + + def is_auth_error(self): + """ + Check if the union tag is ``auth_error``. + + :rtype: bool + """ + return self._tag == 'auth_error' + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == 'other' + + def get_auth_error(self): + """ + Only call this if :meth:`is_auth_error` is true. + + :rtype: AuthError + """ + if not self.is_auth_error(): + raise AttributeError("tag 'auth_error' not set") + return self._value + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(ErrUnion, self)._process_custom_annotations(annotation_type, field_path, processor) + +ErrUnion_validator = bv.Union(ErrUnion) + +AuthError._invalid_token_validator = bv.Void() +AuthError._no_openid_auth_validator = bv.Void() +AuthError._other_validator = bv.Void() +AuthError._tagmap = { + 'invalid_token': AuthError._invalid_token_validator, + 'no_openid_auth': AuthError._no_openid_auth_validator, + 'other': AuthError._other_validator, +} + +AuthError.invalid_token = AuthError('invalid_token') +AuthError.no_openid_auth = AuthError('no_openid_auth') +AuthError.other = AuthError('other') + +UserInfoArgs._all_field_names_ = set([]) +UserInfoArgs._all_fields_ = [] + +UserInfoError.err.validator = bv.Nullable(ErrUnion_validator) +UserInfoError.error_message.validator = bv.String() +UserInfoError._all_field_names_ = set([ + 'err', + 'error_message', +]) +UserInfoError._all_fields_ = [ + ('err', UserInfoError.err.validator), + ('error_message', UserInfoError.error_message.validator), +] + +UserInfoResult.family_name.validator = bv.Nullable(bv.String()) +UserInfoResult.given_name.validator = bv.Nullable(bv.String()) +UserInfoResult.email.validator = bv.Nullable(bv.String()) +UserInfoResult.email_verified.validator = bv.Nullable(bv.Boolean()) +UserInfoResult.iss.validator = bv.String() +UserInfoResult.sub.validator = bv.String() +UserInfoResult._all_field_names_ = set([ + 'family_name', + 'given_name', + 'email', + 'email_verified', + 'iss', + 'sub', +]) +UserInfoResult._all_fields_ = [ + ('family_name', UserInfoResult.family_name.validator), + ('given_name', UserInfoResult.given_name.validator), + ('email', UserInfoResult.email.validator), + ('email_verified', UserInfoResult.email_verified.validator), + ('iss', UserInfoResult.iss.validator), + ('sub', UserInfoResult.sub.validator), +] + +ErrUnion._auth_error_validator = AuthError_validator +ErrUnion._other_validator = bv.Void() +ErrUnion._tagmap = { + 'auth_error': ErrUnion._auth_error_validator, + 'other': ErrUnion._other_validator, +} + +ErrUnion.other = ErrUnion('other') + +UserInfoError.error_message.default = '' +UserInfoResult.iss.default = '' +UserInfoResult.sub.default = '' +ROUTES = { +} + diff --git a/dropbox/sharing.py b/dropbox/sharing.py index e992c242..37547b6c 100644 --- a/dropbox/sharing.py +++ b/dropbox/sharing.py @@ -2349,24 +2349,40 @@ class FileMemberActionResult(bb.Struct): :ivar sharing.FileMemberActionResult.member: One of specified input members. :ivar sharing.FileMemberActionResult.result: The outcome of the action on this member. + :ivar sharing.FileMemberActionResult.sckey_sha1: The SHA-1 encrypted shared + content key. + :ivar sharing.FileMemberActionResult.invitation_signature: The sharing + sender-recipient invitation signatures for the input member_id. A + member_id can be a group and thus have multiple users and multiple + invitation signatures. """ __slots__ = [ '_member_value', '_result_value', + '_sckey_sha1_value', + '_invitation_signature_value', ] _has_required_fields = True def __init__(self, member=None, - result=None): + result=None, + sckey_sha1=None, + invitation_signature=None): self._member_value = bb.NOT_SET self._result_value = bb.NOT_SET + self._sckey_sha1_value = bb.NOT_SET + self._invitation_signature_value = bb.NOT_SET if member is not None: self.member = member if result is not None: self.result = result + if sckey_sha1 is not None: + self.sckey_sha1 = sckey_sha1 + if invitation_signature is not None: + self.invitation_signature = invitation_signature # Instance attribute type: MemberSelector (validator is set below) member = bb.Attribute("member", user_defined=True) @@ -2374,6 +2390,12 @@ def __init__(self, # Instance attribute type: FileMemberActionIndividualResult (validator is set below) result = bb.Attribute("result", user_defined=True) + # Instance attribute type: str (validator is set below) + sckey_sha1 = bb.Attribute("sckey_sha1", nullable=True) + + # Instance attribute type: list of [str] (validator is set below) + invitation_signature = bb.Attribute("invitation_signature", nullable=True) + def _process_custom_annotations(self, annotation_type, field_path, processor): super(FileMemberActionResult, self)._process_custom_annotations(annotation_type, field_path, processor) @@ -11533,13 +11555,19 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): FileMemberActionResult.member.validator = MemberSelector_validator FileMemberActionResult.result.validator = FileMemberActionIndividualResult_validator +FileMemberActionResult.sckey_sha1.validator = bv.Nullable(bv.String()) +FileMemberActionResult.invitation_signature.validator = bv.Nullable(bv.List(bv.String())) FileMemberActionResult._all_field_names_ = set([ 'member', 'result', + 'sckey_sha1', + 'invitation_signature', ]) FileMemberActionResult._all_fields_ = [ ('member', FileMemberActionResult.member.validator), ('result', FileMemberActionResult.result.validator), + ('sckey_sha1', FileMemberActionResult.sckey_sha1.validator), + ('invitation_signature', FileMemberActionResult.invitation_signature.validator), ] FileMemberRemoveActionResult._success_validator = MemberAccessLevelResult_validator diff --git a/dropbox/team_log.py b/dropbox/team_log.py index 63ec670e..11c4feef 100644 --- a/dropbox/team_log.py +++ b/dropbox/team_log.py @@ -1862,6 +1862,121 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): AdminConsoleAppPolicy_validator = bv.Union(AdminConsoleAppPolicy) +class AdminEmailRemindersChangedDetails(bb.Struct): + """ + Changed admin email reminder policy for team requests to join. + + :ivar team_log.AdminEmailRemindersChangedDetails.new_value: To. + :ivar team_log.AdminEmailRemindersChangedDetails.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: AdminEmailRemindersPolicy (validator is set below) + new_value = bb.Attribute("new_value", user_defined=True) + + # Instance attribute type: AdminEmailRemindersPolicy (validator is set below) + previous_value = bb.Attribute("previous_value", user_defined=True) + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(AdminEmailRemindersChangedDetails, self)._process_custom_annotations(annotation_type, field_path, processor) + +AdminEmailRemindersChangedDetails_validator = bv.Struct(AdminEmailRemindersChangedDetails) + +class AdminEmailRemindersChangedType(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(AdminEmailRemindersChangedType, self)._process_custom_annotations(annotation_type, field_path, processor) + +AdminEmailRemindersChangedType_validator = bv.Struct(AdminEmailRemindersChangedType) + +class AdminEmailRemindersPolicy(bb.Union): + """ + Policy for deciding whether team admins receive reminder emails for requests + to join the team + + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + """ + + _catch_all = 'other' + # Attribute is overwritten below the class definition + default = None + # Attribute is overwritten below the class definition + disabled = None + # Attribute is overwritten below the class definition + enabled = None + # Attribute is overwritten below the class definition + other = None + + def is_default(self): + """ + Check if the union tag is ``default``. + + :rtype: bool + """ + return self._tag == 'default' + + def is_disabled(self): + """ + Check if the union tag is ``disabled``. + + :rtype: bool + """ + return self._tag == 'disabled' + + def is_enabled(self): + """ + Check if the union tag is ``enabled``. + + :rtype: bool + """ + return self._tag == 'enabled' + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == 'other' + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(AdminEmailRemindersPolicy, self)._process_custom_annotations(annotation_type, field_path, processor) + +AdminEmailRemindersPolicy_validator = bv.Union(AdminEmailRemindersPolicy) + class AdminRole(bb.Union): """ This class acts as a tagged union. Only one of the ``is_*`` methods will @@ -12187,6 +12302,17 @@ def account_capture_change_policy_details(cls, val): """ return cls('account_capture_change_policy_details', val) + @classmethod + def admin_email_reminders_changed_details(cls, val): + """ + Create an instance of this class set to the + ``admin_email_reminders_changed_details`` tag with value ``val``. + + :param AdminEmailRemindersChangedDetails val: + :rtype: EventDetails + """ + return cls('admin_email_reminders_changed_details', val) + @classmethod def allow_download_disabled_details(cls, val): """ @@ -16467,6 +16593,14 @@ def is_account_capture_change_policy_details(self): """ return self._tag == 'account_capture_change_policy_details' + def is_admin_email_reminders_changed_details(self): + """ + Check if the union tag is ``admin_email_reminders_changed_details``. + + :rtype: bool + """ + return self._tag == 'admin_email_reminders_changed_details' + def is_allow_download_disabled_details(self): """ Check if the union tag is ``allow_download_disabled_details``. @@ -21037,6 +21171,16 @@ def get_account_capture_change_policy_details(self): raise AttributeError("tag 'account_capture_change_policy_details' not set") return self._value + def get_admin_email_reminders_changed_details(self): + """ + Only call this if :meth:`is_admin_email_reminders_changed_details` is true. + + :rtype: AdminEmailRemindersChangedDetails + """ + if not self.is_admin_email_reminders_changed_details(): + raise AttributeError("tag 'admin_email_reminders_changed_details' not set") + return self._value + def get_allow_download_disabled_details(self): """ Only call this if :meth:`is_allow_download_disabled_details` is true. @@ -23158,6 +23302,9 @@ class EventType(bb.Union): :ivar AccountCaptureChangePolicyType EventType.account_capture_change_policy: (team_policies) Changed account capture setting on team domain + :ivar AdminEmailRemindersChangedType + EventType.admin_email_reminders_changed: (team_policies) Changed admin + email reminder policy for team requests to join :ivar AllowDownloadDisabledType EventType.allow_download_disabled: (team_policies) Disabled downloads (deprecated, no longer logged) :ivar AllowDownloadEnabledType EventType.allow_download_enabled: @@ -27408,6 +27555,17 @@ def account_capture_change_policy(cls, val): """ return cls('account_capture_change_policy', val) + @classmethod + def admin_email_reminders_changed(cls, val): + """ + Create an instance of this class set to the + ``admin_email_reminders_changed`` tag with value ``val``. + + :param AdminEmailRemindersChangedType val: + :rtype: EventType + """ + return cls('admin_email_reminders_changed', val) + @classmethod def allow_download_disabled(cls, val): """ @@ -31655,6 +31813,14 @@ def is_account_capture_change_policy(self): """ return self._tag == 'account_capture_change_policy' + def is_admin_email_reminders_changed(self): + """ + Check if the union tag is ``admin_email_reminders_changed``. + + :rtype: bool + """ + return self._tag == 'admin_email_reminders_changed' + def is_allow_download_disabled(self): """ Check if the union tag is ``allow_download_disabled``. @@ -36967,6 +37133,19 @@ def get_account_capture_change_policy(self): raise AttributeError("tag 'account_capture_change_policy' not set") return self._value + def get_admin_email_reminders_changed(self): + """ + (team_policies) Changed admin email reminder policy for team requests to + join + + Only call this if :meth:`is_admin_email_reminders_changed` is true. + + :rtype: AdminEmailRemindersChangedType + """ + if not self.is_admin_email_reminders_changed(): + raise AttributeError("tag 'admin_email_reminders_changed' not set") + return self._value + def get_allow_download_disabled(self): """ (team_policies) Disabled downloads (deprecated, no longer logged) @@ -39253,6 +39432,8 @@ class EventTypeArg(bb.Union): (team_folders) Changed sync default :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 :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 @@ -40262,6 +40443,8 @@ class EventTypeArg(bb.Union): # Attribute is overwritten below the class definition account_capture_change_policy = None # Attribute is overwritten below the class definition + admin_email_reminders_changed = None + # Attribute is overwritten below the class definition allow_download_disabled = None # Attribute is overwritten below the class definition allow_download_enabled = None @@ -43344,6 +43527,14 @@ def is_account_capture_change_policy(self): """ return self._tag == 'account_capture_change_policy' + def is_admin_email_reminders_changed(self): + """ + Check if the union tag is ``admin_email_reminders_changed``. + + :rtype: bool + """ + return self._tag == 'admin_email_reminders_changed' + def is_allow_download_disabled(self): """ Check if the union tag is ``allow_download_disabled``. @@ -73318,6 +73509,37 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): AdminConsoleAppPolicy.default = AdminConsoleAppPolicy('default') AdminConsoleAppPolicy.other = AdminConsoleAppPolicy('other') +AdminEmailRemindersChangedDetails.new_value.validator = AdminEmailRemindersPolicy_validator +AdminEmailRemindersChangedDetails.previous_value.validator = AdminEmailRemindersPolicy_validator +AdminEmailRemindersChangedDetails._all_field_names_ = set([ + 'new_value', + 'previous_value', +]) +AdminEmailRemindersChangedDetails._all_fields_ = [ + ('new_value', AdminEmailRemindersChangedDetails.new_value.validator), + ('previous_value', AdminEmailRemindersChangedDetails.previous_value.validator), +] + +AdminEmailRemindersChangedType.description.validator = bv.String() +AdminEmailRemindersChangedType._all_field_names_ = set(['description']) +AdminEmailRemindersChangedType._all_fields_ = [('description', AdminEmailRemindersChangedType.description.validator)] + +AdminEmailRemindersPolicy._default_validator = bv.Void() +AdminEmailRemindersPolicy._disabled_validator = bv.Void() +AdminEmailRemindersPolicy._enabled_validator = bv.Void() +AdminEmailRemindersPolicy._other_validator = bv.Void() +AdminEmailRemindersPolicy._tagmap = { + 'default': AdminEmailRemindersPolicy._default_validator, + 'disabled': AdminEmailRemindersPolicy._disabled_validator, + 'enabled': AdminEmailRemindersPolicy._enabled_validator, + 'other': AdminEmailRemindersPolicy._other_validator, +} + +AdminEmailRemindersPolicy.default = AdminEmailRemindersPolicy('default') +AdminEmailRemindersPolicy.disabled = AdminEmailRemindersPolicy('disabled') +AdminEmailRemindersPolicy.enabled = AdminEmailRemindersPolicy('enabled') +AdminEmailRemindersPolicy.other = AdminEmailRemindersPolicy('other') + AdminRole._billing_admin_validator = bv.Void() AdminRole._compliance_admin_validator = bv.Void() AdminRole._content_admin_validator = bv.Void() @@ -75170,6 +75392,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventDetails._team_folder_rename_details_validator = TeamFolderRenameDetails_validator EventDetails._team_selective_sync_settings_changed_details_validator = TeamSelectiveSyncSettingsChangedDetails_validator EventDetails._account_capture_change_policy_details_validator = AccountCaptureChangePolicyDetails_validator +EventDetails._admin_email_reminders_changed_details_validator = AdminEmailRemindersChangedDetails_validator EventDetails._allow_download_disabled_details_validator = AllowDownloadDisabledDetails_validator EventDetails._allow_download_enabled_details_validator = AllowDownloadEnabledDetails_validator EventDetails._app_permissions_changed_details_validator = AppPermissionsChangedDetails_validator @@ -75654,6 +75877,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): 'team_folder_rename_details': EventDetails._team_folder_rename_details_validator, 'team_selective_sync_settings_changed_details': EventDetails._team_selective_sync_settings_changed_details_validator, 'account_capture_change_policy_details': EventDetails._account_capture_change_policy_details_validator, + 'admin_email_reminders_changed_details': EventDetails._admin_email_reminders_changed_details_validator, 'allow_download_disabled_details': EventDetails._allow_download_disabled_details_validator, 'allow_download_enabled_details': EventDetails._allow_download_enabled_details_validator, 'app_permissions_changed_details': EventDetails._app_permissions_changed_details_validator, @@ -76141,6 +76365,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventType._team_folder_rename_validator = TeamFolderRenameType_validator EventType._team_selective_sync_settings_changed_validator = TeamSelectiveSyncSettingsChangedType_validator EventType._account_capture_change_policy_validator = AccountCaptureChangePolicyType_validator +EventType._admin_email_reminders_changed_validator = AdminEmailRemindersChangedType_validator EventType._allow_download_disabled_validator = AllowDownloadDisabledType_validator EventType._allow_download_enabled_validator = AllowDownloadEnabledType_validator EventType._app_permissions_changed_validator = AppPermissionsChangedType_validator @@ -76624,6 +76849,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): 'team_folder_rename': EventType._team_folder_rename_validator, 'team_selective_sync_settings_changed': EventType._team_selective_sync_settings_changed_validator, 'account_capture_change_policy': EventType._account_capture_change_policy_validator, + 'admin_email_reminders_changed': EventType._admin_email_reminders_changed_validator, 'allow_download_disabled': EventType._allow_download_disabled_validator, 'allow_download_enabled': EventType._allow_download_enabled_validator, 'app_permissions_changed': EventType._app_permissions_changed_validator, @@ -77110,6 +77336,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventTypeArg._team_folder_rename_validator = bv.Void() EventTypeArg._team_selective_sync_settings_changed_validator = bv.Void() EventTypeArg._account_capture_change_policy_validator = bv.Void() +EventTypeArg._admin_email_reminders_changed_validator = bv.Void() EventTypeArg._allow_download_disabled_validator = bv.Void() EventTypeArg._allow_download_enabled_validator = bv.Void() EventTypeArg._app_permissions_changed_validator = bv.Void() @@ -77593,6 +77820,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): 'team_folder_rename': EventTypeArg._team_folder_rename_validator, 'team_selective_sync_settings_changed': EventTypeArg._team_selective_sync_settings_changed_validator, 'account_capture_change_policy': EventTypeArg._account_capture_change_policy_validator, + 'admin_email_reminders_changed': EventTypeArg._admin_email_reminders_changed_validator, 'allow_download_disabled': EventTypeArg._allow_download_disabled_validator, 'allow_download_enabled': EventTypeArg._allow_download_enabled_validator, 'app_permissions_changed': EventTypeArg._app_permissions_changed_validator, @@ -78077,6 +78305,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): EventTypeArg.team_folder_rename = EventTypeArg('team_folder_rename') EventTypeArg.team_selective_sync_settings_changed = EventTypeArg('team_selective_sync_settings_changed') EventTypeArg.account_capture_change_policy = EventTypeArg('account_capture_change_policy') +EventTypeArg.admin_email_reminders_changed = EventTypeArg('admin_email_reminders_changed') EventTypeArg.allow_download_disabled = EventTypeArg('allow_download_disabled') EventTypeArg.allow_download_enabled = EventTypeArg('allow_download_enabled') EventTypeArg.app_permissions_changed = EventTypeArg('app_permissions_changed') diff --git a/dropbox/team_policies.py b/dropbox/team_policies.py index c85e5af1..045a5df1 100644 --- a/dropbox/team_policies.py +++ b/dropbox/team_policies.py @@ -285,6 +285,67 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): FileLockingPolicyState_validator = bv.Union(FileLockingPolicyState) +class FileProviderMigrationPolicyState(bb.Union): + """ + This class acts as a tagged union. Only one of the ``is_*`` methods will + return true. To get the associated value of a tag (if one exists), use the + corresponding ``get_*`` method. + + :ivar team_policies.FileProviderMigrationPolicyState.disabled: Team admin + has opted out of File Provider Migration for team members. + :ivar team_policies.FileProviderMigrationPolicyState.enabled: Team admin has + not opted out of File Provider Migration for team members. + :ivar team_policies.FileProviderMigrationPolicyState.default: Team admin has + default value based on team tier. + """ + + _catch_all = 'other' + # Attribute is overwritten below the class definition + disabled = None + # Attribute is overwritten below the class definition + enabled = None + # Attribute is overwritten below the class definition + default = None + # Attribute is overwritten below the class definition + other = None + + def is_disabled(self): + """ + Check if the union tag is ``disabled``. + + :rtype: bool + """ + return self._tag == 'disabled' + + def is_enabled(self): + """ + Check if the union tag is ``enabled``. + + :rtype: bool + """ + return self._tag == 'enabled' + + def is_default(self): + """ + Check if the union tag is ``default``. + + :rtype: bool + """ + return self._tag == 'default' + + def is_other(self): + """ + Check if the union tag is ``other``. + + :rtype: bool + """ + return self._tag == 'other' + + def _process_custom_annotations(self, annotation_type, field_path, processor): + super(FileProviderMigrationPolicyState, self)._process_custom_annotations(annotation_type, field_path, processor) + +FileProviderMigrationPolicyState_validator = bv.Union(FileProviderMigrationPolicyState) + class GroupCreation(bb.Union): """ This class acts as a tagged union. Only one of the ``is_*`` methods will @@ -1566,6 +1627,22 @@ def _process_custom_annotations(self, annotation_type, field_path, processor): FileLockingPolicyState.enabled = FileLockingPolicyState('enabled') FileLockingPolicyState.other = FileLockingPolicyState('other') +FileProviderMigrationPolicyState._disabled_validator = bv.Void() +FileProviderMigrationPolicyState._enabled_validator = bv.Void() +FileProviderMigrationPolicyState._default_validator = bv.Void() +FileProviderMigrationPolicyState._other_validator = bv.Void() +FileProviderMigrationPolicyState._tagmap = { + 'disabled': FileProviderMigrationPolicyState._disabled_validator, + 'enabled': FileProviderMigrationPolicyState._enabled_validator, + 'default': FileProviderMigrationPolicyState._default_validator, + 'other': FileProviderMigrationPolicyState._other_validator, +} + +FileProviderMigrationPolicyState.disabled = FileProviderMigrationPolicyState('disabled') +FileProviderMigrationPolicyState.enabled = FileProviderMigrationPolicyState('enabled') +FileProviderMigrationPolicyState.default = FileProviderMigrationPolicyState('default') +FileProviderMigrationPolicyState.other = FileProviderMigrationPolicyState('other') + GroupCreation._admins_and_members_validator = bv.Void() GroupCreation._admins_only_validator = bv.Void() GroupCreation._tagmap = { diff --git a/spec b/spec index c26b11df..f91238c7 160000 --- a/spec +++ b/spec @@ -1 +1 @@ -Subproject commit c26b11df5170dcc03a86046b162c284ed24f7487 +Subproject commit f91238c7508770245030a449d86bd698d30ebfc3