xbmcbackup/resources/lib/dropbox/sharing.py

19912 lines
638 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
2019-08-28 21:48:24 +02:00
# @generated
# flake8: noqa
# pylint: skip-file
"""
This namespace contains endpoints and data types for creating and managing shared links and shared folders.
"""
try:
from . import stone_validators as bv
from . import stone_base as bb
2019-08-28 21:48:24 +02:00
except (ImportError, SystemError, ValueError):
# Catch errors raised when importing a relative module when not in a package.
# This makes testing this file directly (outside of a package) easier.
import stone_validators as bv
import stone_base as bb
try:
from . import (
2019-08-28 21:48:24 +02:00
async_,
common,
files,
2019-08-28 21:48:24 +02:00
seen_state,
team_common,
users,
users_common,
)
2019-08-28 21:48:24 +02:00
except (ImportError, SystemError, ValueError):
import async_
import common
import files
2019-08-28 21:48:24 +02:00
import seen_state
import team_common
import users
import users_common
2019-08-28 21:48:24 +02:00
class AccessInheritance(bb.Union):
"""
Information about the inheritance policy of a shared folder.
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 sharing.AccessInheritance.inherit: The shared folder inherits its
members from the parent folder.
:ivar sharing.AccessInheritance.no_inherit: The shared folder does not
inherit its members from the parent folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
inherit = None
# Attribute is overwritten below the class definition
no_inherit = None
# Attribute is overwritten below the class definition
other = None
def is_inherit(self):
"""
Check if the union tag is ``inherit``.
:rtype: bool
"""
return self._tag == 'inherit'
def is_no_inherit(self):
"""
Check if the union tag is ``no_inherit``.
:rtype: bool
"""
return self._tag == 'no_inherit'
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(AccessInheritance, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AccessInheritance(%r, %r)' % (self._tag, self._value)
AccessInheritance_validator = bv.Union(AccessInheritance)
class AccessLevel(bb.Union):
"""
Defines the access levels for collaborators.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.AccessLevel.owner: The collaborator is the owner of the shared
folder. Owners can view and edit the shared folder as well as set the
folder's policies using
:meth:`dropbox.dropbox.Dropbox.sharing_update_folder_policy`.
:ivar sharing.AccessLevel.editor: The collaborator can both view and edit
the shared folder.
:ivar sharing.AccessLevel.viewer: The collaborator can only view the shared
folder.
:ivar sharing.AccessLevel.viewer_no_comment: The collaborator can only view
the shared folder and does not have any access to comments.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
owner = None
# Attribute is overwritten below the class definition
editor = None
# Attribute is overwritten below the class definition
viewer = None
# Attribute is overwritten below the class definition
viewer_no_comment = None
# Attribute is overwritten below the class definition
other = None
def is_owner(self):
"""
Check if the union tag is ``owner``.
:rtype: bool
"""
return self._tag == 'owner'
def is_editor(self):
"""
Check if the union tag is ``editor``.
:rtype: bool
"""
return self._tag == 'editor'
def is_viewer(self):
"""
Check if the union tag is ``viewer``.
:rtype: bool
"""
return self._tag == 'viewer'
def is_viewer_no_comment(self):
"""
Check if the union tag is ``viewer_no_comment``.
:rtype: bool
"""
return self._tag == 'viewer_no_comment'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AccessLevel, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AccessLevel(%r, %r)' % (self._tag, self._value)
AccessLevel_validator = bv.Union(AccessLevel)
class AclUpdatePolicy(bb.Union):
"""
Who can change a shared folder's access control list (ACL). In other words,
who can add, remove, or change the privileges of members.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.AclUpdatePolicy.owner: Only the owner can update the ACL.
:ivar sharing.AclUpdatePolicy.editors: Any editor can update the ACL. This
may be further restricted to editors on the same team.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
owner = None
# Attribute is overwritten below the class definition
editors = None
# Attribute is overwritten below the class definition
other = None
def is_owner(self):
"""
Check if the union tag is ``owner``.
:rtype: bool
"""
return self._tag == 'owner'
def is_editors(self):
"""
Check if the union tag is ``editors``.
:rtype: bool
"""
return self._tag == 'editors'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AclUpdatePolicy, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AclUpdatePolicy(%r, %r)' % (self._tag, self._value)
AclUpdatePolicy_validator = bv.Union(AclUpdatePolicy)
2019-08-28 21:48:24 +02:00
class AddFileMemberArgs(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.sharing_add_file_member`.
2019-08-28 21:48:24 +02:00
:ivar sharing.AddFileMemberArgs.file: File to which to add members.
:ivar sharing.AddFileMemberArgs.members: Members to add. Note that even an
email address is given, this may result in a user being directy added to
the membership if that email is the user's main account email.
:ivar sharing.AddFileMemberArgs.custom_message: Message to send to added
members in their invitation.
:ivar sharing.AddFileMemberArgs.quiet: Whether added members should be
notified via device notifications of their invitation.
:ivar sharing.AddFileMemberArgs.access_level: AccessLevel union object,
describing what access level we want to give new members.
:ivar sharing.AddFileMemberArgs.add_message_as_comment: If the custom
message should be added as a comment on the file.
"""
__slots__ = [
'_file_value',
'_file_present',
'_members_value',
'_members_present',
'_custom_message_value',
'_custom_message_present',
'_quiet_value',
'_quiet_present',
'_access_level_value',
'_access_level_present',
'_add_message_as_comment_value',
'_add_message_as_comment_present',
]
_has_required_fields = True
def __init__(self,
file=None,
members=None,
custom_message=None,
quiet=None,
access_level=None,
add_message_as_comment=None):
self._file_value = None
self._file_present = False
self._members_value = None
self._members_present = False
self._custom_message_value = None
self._custom_message_present = False
self._quiet_value = None
self._quiet_present = False
self._access_level_value = None
self._access_level_present = False
self._add_message_as_comment_value = None
self._add_message_as_comment_present = False
if file is not None:
self.file = file
if members is not None:
self.members = members
if custom_message is not None:
self.custom_message = custom_message
if quiet is not None:
self.quiet = quiet
if access_level is not None:
self.access_level = access_level
if add_message_as_comment is not None:
self.add_message_as_comment = add_message_as_comment
@property
def file(self):
"""
File to which to add members.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def members(self):
"""
Members to add. Note that even an email address is given, this may
result in a user being directy added to the membership if that email is
the user's main account email.
:rtype: list of [MemberSelector]
"""
if self._members_present:
return self._members_value
else:
raise AttributeError("missing required field 'members'")
@members.setter
def members(self, val):
val = self._members_validator.validate(val)
self._members_value = val
self._members_present = True
@members.deleter
def members(self):
self._members_value = None
self._members_present = False
@property
def custom_message(self):
"""
Message to send to added members in their invitation.
:rtype: str
"""
if self._custom_message_present:
return self._custom_message_value
else:
return None
@custom_message.setter
def custom_message(self, val):
if val is None:
del self.custom_message
return
val = self._custom_message_validator.validate(val)
self._custom_message_value = val
self._custom_message_present = True
@custom_message.deleter
def custom_message(self):
self._custom_message_value = None
self._custom_message_present = False
@property
def quiet(self):
"""
Whether added members should be notified via device notifications of
their invitation.
:rtype: bool
"""
if self._quiet_present:
return self._quiet_value
else:
return False
@quiet.setter
def quiet(self, val):
val = self._quiet_validator.validate(val)
self._quiet_value = val
self._quiet_present = True
@quiet.deleter
def quiet(self):
self._quiet_value = None
self._quiet_present = False
@property
def access_level(self):
"""
AccessLevel union object, describing what access level we want to give
new members.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
return AccessLevel.viewer
@access_level.setter
def access_level(self, val):
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
@property
def add_message_as_comment(self):
"""
If the custom message should be added as a comment on the file.
:rtype: bool
"""
if self._add_message_as_comment_present:
return self._add_message_as_comment_value
else:
return False
@add_message_as_comment.setter
def add_message_as_comment(self, val):
val = self._add_message_as_comment_validator.validate(val)
self._add_message_as_comment_value = val
self._add_message_as_comment_present = True
@add_message_as_comment.deleter
def add_message_as_comment(self):
self._add_message_as_comment_value = None
self._add_message_as_comment_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddFileMemberArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AddFileMemberArgs(file={!r}, members={!r}, custom_message={!r}, quiet={!r}, access_level={!r}, add_message_as_comment={!r})'.format(
self._file_value,
self._members_value,
self._custom_message_value,
self._quiet_value,
self._access_level_value,
self._add_message_as_comment_value,
)
AddFileMemberArgs_validator = bv.Struct(AddFileMemberArgs)
class AddFileMemberError(bb.Union):
"""
Errors for :meth:`dropbox.dropbox.Dropbox.sharing_add_file_member`.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.AddFileMemberError.rate_limit: The user has reached the rate
limit for invitations.
:ivar sharing.AddFileMemberError.invalid_comment: The custom message did not
pass comment permissions checks.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
rate_limit = None
# Attribute is overwritten below the class definition
invalid_comment = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: AddFileMemberError
"""
return cls('user_error', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: AddFileMemberError
"""
return cls('access_error', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_rate_limit(self):
"""
Check if the union tag is ``rate_limit``.
:rtype: bool
"""
return self._tag == 'rate_limit'
def is_invalid_comment(self):
"""
Check if the union tag is ``invalid_comment``.
:rtype: bool
"""
return self._tag == 'invalid_comment'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddFileMemberError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AddFileMemberError(%r, %r)' % (self._tag, self._value)
AddFileMemberError_validator = bv.Union(AddFileMemberError)
2019-08-28 21:48:24 +02:00
class AddFolderMemberArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.AddFolderMemberArg.shared_folder_id: The ID for the shared
folder.
:ivar sharing.AddFolderMemberArg.members: The intended list of members to
add. Added members will receive invites to join the shared folder.
:ivar sharing.AddFolderMemberArg.quiet: Whether added members should be
notified via email and device notifications of their invite.
:ivar sharing.AddFolderMemberArg.custom_message: Optional message to display
to added members in their invitation.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_members_value',
'_members_present',
'_quiet_value',
'_quiet_present',
'_custom_message_value',
'_custom_message_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
members=None,
quiet=None,
custom_message=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._members_value = None
self._members_present = False
self._quiet_value = None
self._quiet_present = False
self._custom_message_value = None
self._custom_message_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if members is not None:
self.members = members
if quiet is not None:
self.quiet = quiet
if custom_message is not None:
self.custom_message = custom_message
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def members(self):
"""
The intended list of members to add. Added members will receive invites
to join the shared folder.
:rtype: list of [AddMember]
"""
if self._members_present:
return self._members_value
else:
raise AttributeError("missing required field 'members'")
@members.setter
def members(self, val):
val = self._members_validator.validate(val)
self._members_value = val
self._members_present = True
@members.deleter
def members(self):
self._members_value = None
self._members_present = False
@property
def quiet(self):
"""
Whether added members should be notified via email and device
notifications of their invite.
:rtype: bool
"""
if self._quiet_present:
return self._quiet_value
else:
return False
@quiet.setter
def quiet(self, val):
val = self._quiet_validator.validate(val)
self._quiet_value = val
self._quiet_present = True
@quiet.deleter
def quiet(self):
self._quiet_value = None
self._quiet_present = False
@property
def custom_message(self):
"""
Optional message to display to added members in their invitation.
:rtype: str
"""
if self._custom_message_present:
return self._custom_message_value
else:
return None
@custom_message.setter
def custom_message(self, val):
if val is None:
del self.custom_message
return
val = self._custom_message_validator.validate(val)
self._custom_message_value = val
self._custom_message_present = True
@custom_message.deleter
def custom_message(self):
self._custom_message_value = None
self._custom_message_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddFolderMemberArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AddFolderMemberArg(shared_folder_id={!r}, members={!r}, quiet={!r}, custom_message={!r})'.format(
self._shared_folder_id_value,
self._members_value,
self._quiet_value,
self._custom_message_value,
)
AddFolderMemberArg_validator = bv.Struct(AddFolderMemberArg)
class AddFolderMemberError(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.
2019-08-28 21:48:24 +02:00
:ivar SharedFolderAccessError AddFolderMemberError.access_error: Unable to
access shared folder.
:ivar sharing.AddFolderMemberError.email_unverified: The current user's
e-mail address is unverified.
:ivar sharing.AddFolderMemberError.banned_member: The current user has been
banned.
:ivar AddMemberSelectorError AddFolderMemberError.bad_member:
``AddFolderMemberArg.members`` contains a bad invitation recipient.
:ivar sharing.AddFolderMemberError.cant_share_outside_team: Your team policy
does not allow sharing outside of the team.
:ivar int sharing.AddFolderMemberError.too_many_members: The value is the
member limit that was reached.
:ivar int sharing.AddFolderMemberError.too_many_pending_invites: The value
is the pending invite limit that was reached.
:ivar sharing.AddFolderMemberError.rate_limit: The current user has hit the
limit of invites they can send per day. Try again in 24 hours.
:ivar sharing.AddFolderMemberError.too_many_invitees: The current user is
trying to share with too many people at once.
:ivar sharing.AddFolderMemberError.insufficient_plan: The current user's
account doesn't support this action. An example of this is when adding a
read-only member. This action can only be performed by users that have
upgraded to a Pro or Business plan.
:ivar sharing.AddFolderMemberError.team_folder: This action cannot be
performed on a team shared folder.
:ivar sharing.AddFolderMemberError.no_permission: The current user does not
have permission to perform this action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
email_unverified = None
# Attribute is overwritten below the class definition
2019-08-28 21:48:24 +02:00
banned_member = None
# Attribute is overwritten below the class definition
cant_share_outside_team = None
# Attribute is overwritten below the class definition
rate_limit = None
# Attribute is overwritten below the class definition
too_many_invitees = None
# Attribute is overwritten below the class definition
insufficient_plan = None
# Attribute is overwritten below the class definition
team_folder = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: AddFolderMemberError
"""
return cls('access_error', val)
@classmethod
def bad_member(cls, val):
"""
Create an instance of this class set to the ``bad_member`` tag with
value ``val``.
:param AddMemberSelectorError val:
:rtype: AddFolderMemberError
"""
return cls('bad_member', val)
@classmethod
def too_many_members(cls, val):
"""
Create an instance of this class set to the ``too_many_members`` tag
with value ``val``.
2019-08-28 21:48:24 +02:00
:param int val:
:rtype: AddFolderMemberError
"""
return cls('too_many_members', val)
@classmethod
def too_many_pending_invites(cls, val):
"""
Create an instance of this class set to the ``too_many_pending_invites``
tag with value ``val``.
2019-08-28 21:48:24 +02:00
:param int val:
:rtype: AddFolderMemberError
"""
return cls('too_many_pending_invites', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_email_unverified(self):
"""
Check if the union tag is ``email_unverified``.
:rtype: bool
"""
return self._tag == 'email_unverified'
2019-08-28 21:48:24 +02:00
def is_banned_member(self):
"""
Check if the union tag is ``banned_member``.
:rtype: bool
"""
return self._tag == 'banned_member'
def is_bad_member(self):
"""
Check if the union tag is ``bad_member``.
:rtype: bool
"""
return self._tag == 'bad_member'
def is_cant_share_outside_team(self):
"""
Check if the union tag is ``cant_share_outside_team``.
:rtype: bool
"""
return self._tag == 'cant_share_outside_team'
def is_too_many_members(self):
"""
Check if the union tag is ``too_many_members``.
:rtype: bool
"""
return self._tag == 'too_many_members'
def is_too_many_pending_invites(self):
"""
Check if the union tag is ``too_many_pending_invites``.
:rtype: bool
"""
return self._tag == 'too_many_pending_invites'
def is_rate_limit(self):
"""
Check if the union tag is ``rate_limit``.
:rtype: bool
"""
return self._tag == 'rate_limit'
def is_too_many_invitees(self):
"""
Check if the union tag is ``too_many_invitees``.
:rtype: bool
"""
return self._tag == 'too_many_invitees'
def is_insufficient_plan(self):
"""
Check if the union tag is ``insufficient_plan``.
:rtype: bool
"""
return self._tag == 'insufficient_plan'
def is_team_folder(self):
"""
Check if the union tag is ``team_folder``.
:rtype: bool
"""
return self._tag == 'team_folder'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Unable to access shared folder.
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def get_bad_member(self):
"""
``AddFolderMemberArg.members`` contains a bad invitation recipient.
Only call this if :meth:`is_bad_member` is true.
:rtype: AddMemberSelectorError
"""
if not self.is_bad_member():
raise AttributeError("tag 'bad_member' not set")
return self._value
def get_too_many_members(self):
"""
The value is the member limit that was reached.
Only call this if :meth:`is_too_many_members` is true.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if not self.is_too_many_members():
raise AttributeError("tag 'too_many_members' not set")
return self._value
def get_too_many_pending_invites(self):
"""
The value is the pending invite limit that was reached.
Only call this if :meth:`is_too_many_pending_invites` is true.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if not self.is_too_many_pending_invites():
raise AttributeError("tag 'too_many_pending_invites' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddFolderMemberError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AddFolderMemberError(%r, %r)' % (self._tag, self._value)
AddFolderMemberError_validator = bv.Union(AddFolderMemberError)
2019-08-28 21:48:24 +02:00
class AddMember(bb.Struct):
"""
The member and type of access the member should have when added to a shared
folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.AddMember.member: The member to add to the shared folder.
:ivar sharing.AddMember.access_level: The access level to grant ``member``
to the shared folder. ``AccessLevel.owner`` is disallowed.
"""
__slots__ = [
'_member_value',
'_member_present',
'_access_level_value',
'_access_level_present',
]
_has_required_fields = True
def __init__(self,
member=None,
access_level=None):
self._member_value = None
self._member_present = False
self._access_level_value = None
self._access_level_present = False
if member is not None:
self.member = member
if access_level is not None:
self.access_level = access_level
@property
def member(self):
"""
The member to add to the shared folder.
:rtype: MemberSelector
"""
if self._member_present:
return self._member_value
else:
raise AttributeError("missing required field 'member'")
@member.setter
def member(self, val):
self._member_validator.validate_type_only(val)
self._member_value = val
self._member_present = True
@member.deleter
def member(self):
self._member_value = None
self._member_present = False
@property
def access_level(self):
"""
The access level to grant ``member`` to the shared folder.
``AccessLevel.owner`` is disallowed.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
return AccessLevel.viewer
@access_level.setter
def access_level(self, val):
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddMember, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AddMember(member={!r}, access_level={!r})'.format(
self._member_value,
self._access_level_value,
)
AddMember_validator = bv.Struct(AddMember)
class AddMemberSelectorError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.AddMemberSelectorError.automatic_group: Automatically created
groups can only be added to team folders.
:ivar str sharing.AddMemberSelectorError.invalid_dropbox_id: The value is
the ID that could not be identified.
:ivar str sharing.AddMemberSelectorError.invalid_email: The value is the
e-email address that is malformed.
:ivar str sharing.AddMemberSelectorError.unverified_dropbox_id: The value is
the ID of the Dropbox user with an unverified e-mail address. Invite
unverified users by e-mail address instead of by their Dropbox ID.
:ivar sharing.AddMemberSelectorError.group_deleted: At least one of the
specified groups in ``AddFolderMemberArg.members`` is deleted.
:ivar sharing.AddMemberSelectorError.group_not_on_team: Sharing to a group
that is not on the current user's team.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
automatic_group = None
# Attribute is overwritten below the class definition
group_deleted = None
# Attribute is overwritten below the class definition
group_not_on_team = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def invalid_dropbox_id(cls, val):
"""
Create an instance of this class set to the ``invalid_dropbox_id`` tag
with value ``val``.
:param str val:
:rtype: AddMemberSelectorError
"""
return cls('invalid_dropbox_id', val)
@classmethod
def invalid_email(cls, val):
"""
Create an instance of this class set to the ``invalid_email`` tag with
value ``val``.
:param str val:
:rtype: AddMemberSelectorError
"""
return cls('invalid_email', val)
@classmethod
def unverified_dropbox_id(cls, val):
"""
Create an instance of this class set to the ``unverified_dropbox_id``
tag with value ``val``.
:param str val:
:rtype: AddMemberSelectorError
"""
return cls('unverified_dropbox_id', val)
def is_automatic_group(self):
"""
Check if the union tag is ``automatic_group``.
:rtype: bool
"""
return self._tag == 'automatic_group'
def is_invalid_dropbox_id(self):
"""
Check if the union tag is ``invalid_dropbox_id``.
:rtype: bool
"""
return self._tag == 'invalid_dropbox_id'
def is_invalid_email(self):
"""
Check if the union tag is ``invalid_email``.
:rtype: bool
"""
return self._tag == 'invalid_email'
def is_unverified_dropbox_id(self):
"""
Check if the union tag is ``unverified_dropbox_id``.
:rtype: bool
"""
return self._tag == 'unverified_dropbox_id'
def is_group_deleted(self):
"""
Check if the union tag is ``group_deleted``.
:rtype: bool
"""
return self._tag == 'group_deleted'
def is_group_not_on_team(self):
"""
Check if the union tag is ``group_not_on_team``.
:rtype: bool
"""
return self._tag == 'group_not_on_team'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_invalid_dropbox_id(self):
"""
The value is the ID that could not be identified.
Only call this if :meth:`is_invalid_dropbox_id` is true.
:rtype: str
"""
if not self.is_invalid_dropbox_id():
raise AttributeError("tag 'invalid_dropbox_id' not set")
return self._value
def get_invalid_email(self):
"""
The value is the e-email address that is malformed.
Only call this if :meth:`is_invalid_email` is true.
:rtype: str
"""
if not self.is_invalid_email():
raise AttributeError("tag 'invalid_email' not set")
return self._value
def get_unverified_dropbox_id(self):
"""
The value is the ID of the Dropbox user with an unverified e-mail
address. Invite unverified users by e-mail address instead of by their
Dropbox ID.
Only call this if :meth:`is_unverified_dropbox_id` is true.
:rtype: str
"""
if not self.is_unverified_dropbox_id():
raise AttributeError("tag 'unverified_dropbox_id' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AddMemberSelectorError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AddMemberSelectorError(%r, %r)' % (self._tag, self._value)
AddMemberSelectorError_validator = bv.Union(AddMemberSelectorError)
2019-08-28 21:48:24 +02:00
class AudienceExceptionContentInfo(bb.Struct):
"""
Information about the content that has a link audience different than that
of this folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.AudienceExceptionContentInfo.name: The name of the content,
which is either a file or a folder.
"""
__slots__ = [
'_name_value',
'_name_present',
]
_has_required_fields = True
def __init__(self,
name=None):
self._name_value = None
self._name_present = False
if name is not None:
self.name = name
@property
def name(self):
"""
The name of the content, which is either a file or a folder.
:rtype: str
"""
if self._name_present:
return self._name_value
else:
raise AttributeError("missing required field 'name'")
@name.setter
def name(self, val):
val = self._name_validator.validate(val)
self._name_value = val
self._name_present = True
@name.deleter
def name(self):
self._name_value = None
self._name_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AudienceExceptionContentInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AudienceExceptionContentInfo(name={!r})'.format(
self._name_value,
)
AudienceExceptionContentInfo_validator = bv.Struct(AudienceExceptionContentInfo)
2019-08-28 21:48:24 +02:00
class AudienceExceptions(bb.Struct):
"""
The total count and truncated list of information of content inside this
folder that has a different audience than the link on this folder. This is
only returned for folders.
2019-08-28 21:48:24 +02:00
:ivar sharing.AudienceExceptions.exceptions: A truncated list of some of the
content that is an exception. The length of this list could be smaller
than the count since it is only a sample but will not be empty as long
as count is not 0.
"""
__slots__ = [
'_count_value',
'_count_present',
'_exceptions_value',
'_exceptions_present',
]
_has_required_fields = True
def __init__(self,
count=None,
exceptions=None):
self._count_value = None
self._count_present = False
self._exceptions_value = None
self._exceptions_present = False
if count is not None:
self.count = count
if exceptions is not None:
self.exceptions = exceptions
@property
def count(self):
"""
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._count_present:
return self._count_value
else:
raise AttributeError("missing required field 'count'")
@count.setter
def count(self, val):
val = self._count_validator.validate(val)
self._count_value = val
self._count_present = True
@count.deleter
def count(self):
self._count_value = None
self._count_present = False
@property
def exceptions(self):
"""
A truncated list of some of the content that is an exception. The length
of this list could be smaller than the count since it is only a sample
but will not be empty as long as count is not 0.
:rtype: list of [AudienceExceptionContentInfo]
"""
if self._exceptions_present:
return self._exceptions_value
else:
raise AttributeError("missing required field 'exceptions'")
@exceptions.setter
def exceptions(self, val):
val = self._exceptions_validator.validate(val)
self._exceptions_value = val
self._exceptions_present = True
@exceptions.deleter
def exceptions(self):
self._exceptions_value = None
self._exceptions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AudienceExceptions, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AudienceExceptions(count={!r}, exceptions={!r})'.format(
self._count_value,
self._exceptions_value,
)
AudienceExceptions_validator = bv.Struct(AudienceExceptions)
2019-08-28 21:48:24 +02:00
class AudienceRestrictingSharedFolder(bb.Struct):
"""
Information about the shared folder that prevents the link audience for this
link from being more restrictive.
2019-08-28 21:48:24 +02:00
:ivar sharing.AudienceRestrictingSharedFolder.shared_folder_id: The ID of
the shared folder.
:ivar sharing.AudienceRestrictingSharedFolder.name: The name of the shared
folder.
:ivar sharing.AudienceRestrictingSharedFolder.audience: The link audience of
the shared folder.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_name_value',
'_name_present',
'_audience_value',
'_audience_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
name=None,
audience=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._name_value = None
self._name_present = False
self._audience_value = None
self._audience_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if name is not None:
self.name = name
if audience is not None:
self.audience = audience
@property
def shared_folder_id(self):
"""
The ID of the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def name(self):
"""
The name of the shared folder.
:rtype: str
"""
if self._name_present:
return self._name_value
else:
raise AttributeError("missing required field 'name'")
@name.setter
def name(self, val):
val = self._name_validator.validate(val)
self._name_value = val
self._name_present = True
@name.deleter
def name(self):
self._name_value = None
self._name_present = False
@property
def audience(self):
"""
The link audience of the shared folder.
:rtype: LinkAudience
"""
if self._audience_present:
return self._audience_value
else:
raise AttributeError("missing required field 'audience'")
@audience.setter
def audience(self, val):
self._audience_validator.validate_type_only(val)
self._audience_value = val
self._audience_present = True
@audience.deleter
def audience(self):
self._audience_value = None
self._audience_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(AudienceRestrictingSharedFolder, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'AudienceRestrictingSharedFolder(shared_folder_id={!r}, name={!r}, audience={!r})'.format(
self._shared_folder_id_value,
self._name_value,
self._audience_value,
)
AudienceRestrictingSharedFolder_validator = bv.Struct(AudienceRestrictingSharedFolder)
2019-08-28 21:48:24 +02:00
class ChangeFileMemberAccessArgs(bb.Struct):
"""
Arguments for
:meth:`dropbox.dropbox.Dropbox.sharing_change_file_member_access`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ChangeFileMemberAccessArgs.file: File for which we are
changing a member's access.
:ivar sharing.ChangeFileMemberAccessArgs.member: The member whose access we
are changing.
:ivar sharing.ChangeFileMemberAccessArgs.access_level: The new access level
for the member.
"""
__slots__ = [
'_file_value',
'_file_present',
'_member_value',
'_member_present',
'_access_level_value',
'_access_level_present',
]
_has_required_fields = True
def __init__(self,
file=None,
member=None,
access_level=None):
self._file_value = None
self._file_present = False
self._member_value = None
self._member_present = False
self._access_level_value = None
self._access_level_present = False
if file is not None:
self.file = file
if member is not None:
self.member = member
if access_level is not None:
self.access_level = access_level
@property
def file(self):
"""
File for which we are changing a member's access.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def member(self):
"""
The member whose access we are changing.
:rtype: MemberSelector
"""
if self._member_present:
return self._member_value
else:
raise AttributeError("missing required field 'member'")
@member.setter
def member(self, val):
self._member_validator.validate_type_only(val)
self._member_value = val
self._member_present = True
@member.deleter
def member(self):
self._member_value = None
self._member_present = False
@property
def access_level(self):
"""
The new access level for the member.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
raise AttributeError("missing required field 'access_level'")
@access_level.setter
def access_level(self, val):
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ChangeFileMemberAccessArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ChangeFileMemberAccessArgs(file={!r}, member={!r}, access_level={!r})'.format(
self._file_value,
self._member_value,
self._access_level_value,
)
ChangeFileMemberAccessArgs_validator = bv.Struct(ChangeFileMemberAccessArgs)
2019-08-28 21:48:24 +02:00
class LinkMetadata(bb.Struct):
"""
Metadata for a shared link. This can be either a :class:`PathLinkMetadata`
or :class:`CollectionLinkMetadata`.
2019-08-28 21:48:24 +02:00
:ivar sharing.LinkMetadata.url: URL of the shared link.
:ivar sharing.LinkMetadata.visibility: Who can access the link.
:ivar sharing.LinkMetadata.expires: Expiration time, if set. By default the
link won't expire.
"""
__slots__ = [
'_url_value',
'_url_present',
'_visibility_value',
'_visibility_present',
'_expires_value',
'_expires_present',
]
_has_required_fields = True
def __init__(self,
url=None,
visibility=None,
expires=None):
self._url_value = None
self._url_present = False
self._visibility_value = None
self._visibility_present = False
self._expires_value = None
self._expires_present = False
if url is not None:
self.url = url
if visibility is not None:
self.visibility = visibility
if expires is not None:
self.expires = expires
@property
def url(self):
"""
URL of the shared link.
:rtype: str
"""
if self._url_present:
return self._url_value
else:
raise AttributeError("missing required field 'url'")
@url.setter
def url(self, val):
val = self._url_validator.validate(val)
self._url_value = val
self._url_present = True
@url.deleter
def url(self):
self._url_value = None
self._url_present = False
@property
def visibility(self):
"""
Who can access the link.
:rtype: Visibility
"""
if self._visibility_present:
return self._visibility_value
else:
raise AttributeError("missing required field 'visibility'")
@visibility.setter
def visibility(self, val):
self._visibility_validator.validate_type_only(val)
self._visibility_value = val
self._visibility_present = True
@visibility.deleter
def visibility(self):
self._visibility_value = None
self._visibility_present = False
@property
def expires(self):
"""
Expiration time, if set. By default the link won't expire.
:rtype: datetime.datetime
"""
if self._expires_present:
return self._expires_value
else:
return None
@expires.setter
def expires(self, val):
if val is None:
del self.expires
return
val = self._expires_validator.validate(val)
self._expires_value = val
self._expires_present = True
@expires.deleter
def expires(self):
self._expires_value = None
self._expires_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkMetadata(url={!r}, visibility={!r}, expires={!r})'.format(
self._url_value,
self._visibility_value,
self._expires_value,
)
LinkMetadata_validator = bv.StructTree(LinkMetadata)
class CollectionLinkMetadata(LinkMetadata):
"""
Metadata for a collection-based shared link.
"""
__slots__ = [
]
_has_required_fields = True
def __init__(self,
url=None,
visibility=None,
expires=None):
super(CollectionLinkMetadata, self).__init__(url,
visibility,
expires)
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(CollectionLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'CollectionLinkMetadata(url={!r}, visibility={!r}, expires={!r})'.format(
self._url_value,
self._visibility_value,
self._expires_value,
)
CollectionLinkMetadata_validator = bv.Struct(CollectionLinkMetadata)
2019-08-28 21:48:24 +02:00
class CreateSharedLinkArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.CreateSharedLinkArg.path: The path to share.
:ivar sharing.CreateSharedLinkArg.short_url: Whether to return a shortened
URL.
:ivar sharing.CreateSharedLinkArg.pending_upload: If it's okay to share a
path that does not yet exist, set this to either
``PendingUploadMode.file`` or ``PendingUploadMode.folder`` to indicate
whether to assume it's a file or folder.
"""
__slots__ = [
'_path_value',
'_path_present',
'_short_url_value',
'_short_url_present',
'_pending_upload_value',
'_pending_upload_present',
]
_has_required_fields = True
def __init__(self,
path=None,
short_url=None,
pending_upload=None):
self._path_value = None
self._path_present = False
self._short_url_value = None
self._short_url_present = False
self._pending_upload_value = None
self._pending_upload_present = False
if path is not None:
self.path = path
if short_url is not None:
self.short_url = short_url
if pending_upload is not None:
self.pending_upload = pending_upload
@property
def path(self):
"""
The path to share.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
raise AttributeError("missing required field 'path'")
@path.setter
def path(self, val):
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
@property
def short_url(self):
"""
Whether to return a shortened URL.
:rtype: bool
"""
if self._short_url_present:
return self._short_url_value
else:
return False
@short_url.setter
def short_url(self, val):
val = self._short_url_validator.validate(val)
self._short_url_value = val
self._short_url_present = True
@short_url.deleter
def short_url(self):
self._short_url_value = None
self._short_url_present = False
@property
def pending_upload(self):
"""
If it's okay to share a path that does not yet exist, set this to either
``PendingUploadMode.file`` or ``PendingUploadMode.folder`` to indicate
whether to assume it's a file or folder.
:rtype: PendingUploadMode
"""
if self._pending_upload_present:
return self._pending_upload_value
else:
return None
@pending_upload.setter
def pending_upload(self, val):
if val is None:
del self.pending_upload
return
self._pending_upload_validator.validate_type_only(val)
self._pending_upload_value = val
self._pending_upload_present = True
@pending_upload.deleter
def pending_upload(self):
self._pending_upload_value = None
self._pending_upload_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(CreateSharedLinkArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'CreateSharedLinkArg(path={!r}, short_url={!r}, pending_upload={!r})'.format(
self._path_value,
self._short_url_value,
self._pending_upload_value,
)
CreateSharedLinkArg_validator = bv.Struct(CreateSharedLinkArg)
class CreateSharedLinkError(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 path(cls, val):
"""
Create an instance of this class set to the ``path`` tag with value
``val``.
2019-08-28 21:48:24 +02:00
:param files.LookupError val:
:rtype: CreateSharedLinkError
"""
return cls('path', val)
def is_path(self):
"""
Check if the union tag is ``path``.
:rtype: bool
"""
return self._tag == 'path'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_path(self):
"""
Only call this if :meth:`is_path` is true.
2019-08-28 21:48:24 +02:00
:rtype: files.LookupError
"""
if not self.is_path():
raise AttributeError("tag 'path' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(CreateSharedLinkError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'CreateSharedLinkError(%r, %r)' % (self._tag, self._value)
CreateSharedLinkError_validator = bv.Union(CreateSharedLinkError)
2019-08-28 21:48:24 +02:00
class CreateSharedLinkWithSettingsArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.CreateSharedLinkWithSettingsArg.path: The path to be shared by
the shared link.
:ivar sharing.CreateSharedLinkWithSettingsArg.settings: The requested
settings for the newly created shared link.
"""
__slots__ = [
'_path_value',
'_path_present',
'_settings_value',
'_settings_present',
]
_has_required_fields = True
def __init__(self,
path=None,
settings=None):
self._path_value = None
self._path_present = False
self._settings_value = None
self._settings_present = False
if path is not None:
self.path = path
if settings is not None:
self.settings = settings
@property
def path(self):
"""
The path to be shared by the shared link.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
raise AttributeError("missing required field 'path'")
@path.setter
def path(self, val):
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
@property
def settings(self):
"""
The requested settings for the newly created shared link.
:rtype: SharedLinkSettings
"""
if self._settings_present:
return self._settings_value
else:
return None
@settings.setter
def settings(self, val):
if val is None:
del self.settings
return
self._settings_validator.validate_type_only(val)
self._settings_value = val
self._settings_present = True
@settings.deleter
def settings(self):
self._settings_value = None
self._settings_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(CreateSharedLinkWithSettingsArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'CreateSharedLinkWithSettingsArg(path={!r}, settings={!r})'.format(
self._path_value,
self._settings_value,
)
CreateSharedLinkWithSettingsArg_validator = bv.Struct(CreateSharedLinkWithSettingsArg)
class CreateSharedLinkWithSettingsError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.CreateSharedLinkWithSettingsError.email_not_verified: User's
email should be verified.
:ivar Optional[SharedLinkAlreadyExistsMetadata]
sharing.CreateSharedLinkWithSettingsError.shared_link_already_exists:
The shared link already exists. You can call :route:`list_shared_links`
to get the existing link, or use the provided metadata if it is
returned.
:ivar SharedLinkSettingsError
CreateSharedLinkWithSettingsError.settings_error: There is an error with
the given settings.
:ivar sharing.CreateSharedLinkWithSettingsError.access_denied: Access to the
requested path is forbidden.
"""
_catch_all = None
# Attribute is overwritten below the class definition
email_not_verified = None
# Attribute is overwritten below the class definition
access_denied = None
@classmethod
def path(cls, val):
"""
Create an instance of this class set to the ``path`` tag with value
``val``.
2019-08-28 21:48:24 +02:00
:param files.LookupError val:
:rtype: CreateSharedLinkWithSettingsError
"""
return cls('path', val)
2019-08-28 21:48:24 +02:00
@classmethod
def shared_link_already_exists(cls, val):
"""
Create an instance of this class set to the
``shared_link_already_exists`` tag with value ``val``.
:param SharedLinkAlreadyExistsMetadata val:
:rtype: CreateSharedLinkWithSettingsError
"""
return cls('shared_link_already_exists', val)
@classmethod
def settings_error(cls, val):
"""
Create an instance of this class set to the ``settings_error`` tag with
value ``val``.
:param SharedLinkSettingsError val:
:rtype: CreateSharedLinkWithSettingsError
"""
return cls('settings_error', val)
def is_path(self):
"""
Check if the union tag is ``path``.
:rtype: bool
"""
return self._tag == 'path'
def is_email_not_verified(self):
"""
Check if the union tag is ``email_not_verified``.
:rtype: bool
"""
return self._tag == 'email_not_verified'
def is_shared_link_already_exists(self):
"""
Check if the union tag is ``shared_link_already_exists``.
:rtype: bool
"""
return self._tag == 'shared_link_already_exists'
def is_settings_error(self):
"""
Check if the union tag is ``settings_error``.
:rtype: bool
"""
return self._tag == 'settings_error'
def is_access_denied(self):
"""
Check if the union tag is ``access_denied``.
:rtype: bool
"""
return self._tag == 'access_denied'
def get_path(self):
"""
Only call this if :meth:`is_path` is true.
2019-08-28 21:48:24 +02:00
:rtype: files.LookupError
"""
if not self.is_path():
raise AttributeError("tag 'path' not set")
return self._value
2019-08-28 21:48:24 +02:00
def get_shared_link_already_exists(self):
"""
The shared link already exists. You can call
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` to get the
existing link, or use the provided metadata if it is returned.
Only call this if :meth:`is_shared_link_already_exists` is true.
:rtype: SharedLinkAlreadyExistsMetadata
"""
if not self.is_shared_link_already_exists():
raise AttributeError("tag 'shared_link_already_exists' not set")
return self._value
def get_settings_error(self):
"""
There is an error with the given settings.
Only call this if :meth:`is_settings_error` is true.
:rtype: SharedLinkSettingsError
"""
if not self.is_settings_error():
raise AttributeError("tag 'settings_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(CreateSharedLinkWithSettingsError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'CreateSharedLinkWithSettingsError(%r, %r)' % (self._tag, self._value)
CreateSharedLinkWithSettingsError_validator = bv.Union(CreateSharedLinkWithSettingsError)
2019-08-28 21:48:24 +02:00
class SharedContentLinkMetadataBase(bb.Struct):
"""
:ivar sharing.SharedContentLinkMetadataBase.access_level: The access level
on the link for this file.
:ivar sharing.SharedContentLinkMetadataBase.audience_options: The audience
options that are available for the content. Some audience options may be
unavailable. For example, team_only may be unavailable if the content is
not owned by a user on a team. The 'default' audience option is always
available if the user can modify link settings.
:ivar
sharing.SharedContentLinkMetadataBase.audience_restricting_shared_folder:
The shared folder that prevents the link audience for this link from
being more restrictive.
:ivar sharing.SharedContentLinkMetadataBase.current_audience: The current
audience of the link.
:ivar sharing.SharedContentLinkMetadataBase.expiry: Whether the link has an
expiry set on it. A link with an expiry will have its audience changed
to members when the expiry is reached.
:ivar sharing.SharedContentLinkMetadataBase.link_permissions: A list of
permissions for actions you can perform on the link.
:ivar sharing.SharedContentLinkMetadataBase.password_protected: Whether the
link is protected by a password.
"""
__slots__ = [
'_access_level_value',
'_access_level_present',
'_audience_options_value',
'_audience_options_present',
'_audience_restricting_shared_folder_value',
'_audience_restricting_shared_folder_present',
'_current_audience_value',
'_current_audience_present',
'_expiry_value',
'_expiry_present',
'_link_permissions_value',
'_link_permissions_present',
'_password_protected_value',
'_password_protected_present',
]
_has_required_fields = True
def __init__(self,
audience_options=None,
current_audience=None,
link_permissions=None,
password_protected=None,
access_level=None,
audience_restricting_shared_folder=None,
expiry=None):
self._access_level_value = None
self._access_level_present = False
self._audience_options_value = None
self._audience_options_present = False
self._audience_restricting_shared_folder_value = None
self._audience_restricting_shared_folder_present = False
self._current_audience_value = None
self._current_audience_present = False
self._expiry_value = None
self._expiry_present = False
self._link_permissions_value = None
self._link_permissions_present = False
self._password_protected_value = None
self._password_protected_present = False
if access_level is not None:
self.access_level = access_level
if audience_options is not None:
self.audience_options = audience_options
if audience_restricting_shared_folder is not None:
self.audience_restricting_shared_folder = audience_restricting_shared_folder
if current_audience is not None:
self.current_audience = current_audience
if expiry is not None:
self.expiry = expiry
if link_permissions is not None:
self.link_permissions = link_permissions
if password_protected is not None:
self.password_protected = password_protected
@property
def access_level(self):
"""
The access level on the link for this file.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
return None
@access_level.setter
def access_level(self, val):
if val is None:
del self.access_level
return
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
@property
def audience_options(self):
"""
The audience options that are available for the content. Some audience
options may be unavailable. For example, team_only may be unavailable if
the content is not owned by a user on a team. The 'default' audience
option is always available if the user can modify link settings.
:rtype: list of [LinkAudience]
"""
if self._audience_options_present:
return self._audience_options_value
else:
raise AttributeError("missing required field 'audience_options'")
@audience_options.setter
def audience_options(self, val):
val = self._audience_options_validator.validate(val)
self._audience_options_value = val
self._audience_options_present = True
@audience_options.deleter
def audience_options(self):
self._audience_options_value = None
self._audience_options_present = False
@property
def audience_restricting_shared_folder(self):
"""
The shared folder that prevents the link audience for this link from
being more restrictive.
:rtype: AudienceRestrictingSharedFolder
"""
if self._audience_restricting_shared_folder_present:
return self._audience_restricting_shared_folder_value
else:
return None
@audience_restricting_shared_folder.setter
def audience_restricting_shared_folder(self, val):
if val is None:
del self.audience_restricting_shared_folder
return
self._audience_restricting_shared_folder_validator.validate_type_only(val)
self._audience_restricting_shared_folder_value = val
self._audience_restricting_shared_folder_present = True
@audience_restricting_shared_folder.deleter
def audience_restricting_shared_folder(self):
self._audience_restricting_shared_folder_value = None
self._audience_restricting_shared_folder_present = False
@property
def current_audience(self):
"""
The current audience of the link.
:rtype: LinkAudience
"""
if self._current_audience_present:
return self._current_audience_value
else:
raise AttributeError("missing required field 'current_audience'")
@current_audience.setter
def current_audience(self, val):
self._current_audience_validator.validate_type_only(val)
self._current_audience_value = val
self._current_audience_present = True
@current_audience.deleter
def current_audience(self):
self._current_audience_value = None
self._current_audience_present = False
@property
def expiry(self):
"""
Whether the link has an expiry set on it. A link with an expiry will
have its audience changed to members when the expiry is reached.
:rtype: datetime.datetime
"""
if self._expiry_present:
return self._expiry_value
else:
return None
@expiry.setter
def expiry(self, val):
if val is None:
del self.expiry
return
val = self._expiry_validator.validate(val)
self._expiry_value = val
self._expiry_present = True
@expiry.deleter
def expiry(self):
self._expiry_value = None
self._expiry_present = False
@property
def link_permissions(self):
"""
A list of permissions for actions you can perform on the link.
:rtype: list of [LinkPermission]
"""
if self._link_permissions_present:
return self._link_permissions_value
else:
raise AttributeError("missing required field 'link_permissions'")
@link_permissions.setter
def link_permissions(self, val):
val = self._link_permissions_validator.validate(val)
self._link_permissions_value = val
self._link_permissions_present = True
@link_permissions.deleter
def link_permissions(self):
self._link_permissions_value = None
self._link_permissions_present = False
@property
def password_protected(self):
"""
Whether the link is protected by a password.
:rtype: bool
"""
if self._password_protected_present:
return self._password_protected_value
else:
raise AttributeError("missing required field 'password_protected'")
@password_protected.setter
def password_protected(self, val):
val = self._password_protected_validator.validate(val)
self._password_protected_value = val
self._password_protected_present = True
@password_protected.deleter
def password_protected(self):
self._password_protected_value = None
self._password_protected_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedContentLinkMetadataBase, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedContentLinkMetadataBase(audience_options={!r}, current_audience={!r}, link_permissions={!r}, password_protected={!r}, access_level={!r}, audience_restricting_shared_folder={!r}, expiry={!r})'.format(
self._audience_options_value,
self._current_audience_value,
self._link_permissions_value,
self._password_protected_value,
self._access_level_value,
self._audience_restricting_shared_folder_value,
self._expiry_value,
)
SharedContentLinkMetadataBase_validator = bv.Struct(SharedContentLinkMetadataBase)
class ExpectedSharedContentLinkMetadata(SharedContentLinkMetadataBase):
"""
The expected metadata of a shared link for a file or folder when a link is
first created for the content. Absent if the link already exists.
"""
__slots__ = [
]
_has_required_fields = True
def __init__(self,
audience_options=None,
current_audience=None,
link_permissions=None,
password_protected=None,
access_level=None,
audience_restricting_shared_folder=None,
expiry=None):
super(ExpectedSharedContentLinkMetadata, self).__init__(audience_options,
current_audience,
link_permissions,
password_protected,
access_level,
audience_restricting_shared_folder,
expiry)
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ExpectedSharedContentLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ExpectedSharedContentLinkMetadata(audience_options={!r}, current_audience={!r}, link_permissions={!r}, password_protected={!r}, access_level={!r}, audience_restricting_shared_folder={!r}, expiry={!r})'.format(
self._audience_options_value,
self._current_audience_value,
self._link_permissions_value,
self._password_protected_value,
self._access_level_value,
self._audience_restricting_shared_folder_value,
self._expiry_value,
)
ExpectedSharedContentLinkMetadata_validator = bv.Struct(ExpectedSharedContentLinkMetadata)
class FileAction(bb.Union):
"""
Sharing actions that may be taken on files.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.FileAction.disable_viewer_info: Disable viewer information on
the file.
:ivar sharing.FileAction.edit_contents: Change or edit contents of the file.
:ivar sharing.FileAction.enable_viewer_info: Enable viewer information on
the file.
:ivar sharing.FileAction.invite_viewer: Add a member with view permissions.
:ivar sharing.FileAction.invite_viewer_no_comment: Add a member with view
permissions but no comment permissions.
:ivar sharing.FileAction.invite_editor: Add a member with edit permissions.
:ivar sharing.FileAction.unshare: Stop sharing this file.
:ivar sharing.FileAction.relinquish_membership: Relinquish one's own
membership to the file.
:ivar sharing.FileAction.share_link: Use create_view_link and
create_edit_link instead.
:ivar sharing.FileAction.create_link: Use create_view_link and
create_edit_link instead.
:ivar sharing.FileAction.create_view_link: Create a shared link to a file
that only allows users to view the content.
:ivar sharing.FileAction.create_edit_link: Create a shared link to a file
that allows users to edit the content.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
disable_viewer_info = None
# Attribute is overwritten below the class definition
edit_contents = None
# Attribute is overwritten below the class definition
enable_viewer_info = None
# Attribute is overwritten below the class definition
invite_viewer = None
# Attribute is overwritten below the class definition
invite_viewer_no_comment = None
# Attribute is overwritten below the class definition
2019-08-28 21:48:24 +02:00
invite_editor = None
# Attribute is overwritten below the class definition
unshare = None
# Attribute is overwritten below the class definition
relinquish_membership = None
# Attribute is overwritten below the class definition
share_link = None
# Attribute is overwritten below the class definition
create_link = None
# Attribute is overwritten below the class definition
2019-08-28 21:48:24 +02:00
create_view_link = None
# Attribute is overwritten below the class definition
create_edit_link = None
# Attribute is overwritten below the class definition
other = None
def is_disable_viewer_info(self):
"""
Check if the union tag is ``disable_viewer_info``.
:rtype: bool
"""
return self._tag == 'disable_viewer_info'
def is_edit_contents(self):
"""
Check if the union tag is ``edit_contents``.
:rtype: bool
"""
return self._tag == 'edit_contents'
def is_enable_viewer_info(self):
"""
Check if the union tag is ``enable_viewer_info``.
:rtype: bool
"""
return self._tag == 'enable_viewer_info'
def is_invite_viewer(self):
"""
Check if the union tag is ``invite_viewer``.
:rtype: bool
"""
return self._tag == 'invite_viewer'
def is_invite_viewer_no_comment(self):
"""
Check if the union tag is ``invite_viewer_no_comment``.
:rtype: bool
"""
return self._tag == 'invite_viewer_no_comment'
2019-08-28 21:48:24 +02:00
def is_invite_editor(self):
"""
Check if the union tag is ``invite_editor``.
:rtype: bool
"""
return self._tag == 'invite_editor'
def is_unshare(self):
"""
Check if the union tag is ``unshare``.
:rtype: bool
"""
return self._tag == 'unshare'
def is_relinquish_membership(self):
"""
Check if the union tag is ``relinquish_membership``.
:rtype: bool
"""
return self._tag == 'relinquish_membership'
def is_share_link(self):
"""
Check if the union tag is ``share_link``.
:rtype: bool
"""
return self._tag == 'share_link'
def is_create_link(self):
"""
Check if the union tag is ``create_link``.
:rtype: bool
"""
return self._tag == 'create_link'
2019-08-28 21:48:24 +02:00
def is_create_view_link(self):
"""
Check if the union tag is ``create_view_link``.
:rtype: bool
"""
return self._tag == 'create_view_link'
def is_create_edit_link(self):
"""
Check if the union tag is ``create_edit_link``.
:rtype: bool
"""
return self._tag == 'create_edit_link'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileAction, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileAction(%r, %r)' % (self._tag, self._value)
FileAction_validator = bv.Union(FileAction)
class FileErrorResult(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.
2019-08-28 21:48:24 +02:00
:ivar str sharing.FileErrorResult.file_not_found_error: File specified by id
was not found.
:ivar str sharing.FileErrorResult.invalid_file_action_error: User does not
have permission to take the specified action on the file.
:ivar str sharing.FileErrorResult.permission_denied_error: User does not
have permission to access file specified by file.Id.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def file_not_found_error(cls, val):
"""
Create an instance of this class set to the ``file_not_found_error`` tag
with value ``val``.
:param str val:
:rtype: FileErrorResult
"""
return cls('file_not_found_error', val)
@classmethod
def invalid_file_action_error(cls, val):
"""
Create an instance of this class set to the
``invalid_file_action_error`` tag with value ``val``.
:param str val:
:rtype: FileErrorResult
"""
return cls('invalid_file_action_error', val)
@classmethod
def permission_denied_error(cls, val):
"""
Create an instance of this class set to the ``permission_denied_error``
tag with value ``val``.
:param str val:
:rtype: FileErrorResult
"""
return cls('permission_denied_error', val)
def is_file_not_found_error(self):
"""
Check if the union tag is ``file_not_found_error``.
:rtype: bool
"""
return self._tag == 'file_not_found_error'
def is_invalid_file_action_error(self):
"""
Check if the union tag is ``invalid_file_action_error``.
:rtype: bool
"""
return self._tag == 'invalid_file_action_error'
def is_permission_denied_error(self):
"""
Check if the union tag is ``permission_denied_error``.
:rtype: bool
"""
return self._tag == 'permission_denied_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_file_not_found_error(self):
"""
File specified by id was not found.
Only call this if :meth:`is_file_not_found_error` is true.
:rtype: str
"""
if not self.is_file_not_found_error():
raise AttributeError("tag 'file_not_found_error' not set")
return self._value
def get_invalid_file_action_error(self):
"""
User does not have permission to take the specified action on the file.
Only call this if :meth:`is_invalid_file_action_error` is true.
:rtype: str
"""
if not self.is_invalid_file_action_error():
raise AttributeError("tag 'invalid_file_action_error' not set")
return self._value
def get_permission_denied_error(self):
"""
User does not have permission to access file specified by file.Id.
Only call this if :meth:`is_permission_denied_error` is true.
:rtype: str
"""
if not self.is_permission_denied_error():
raise AttributeError("tag 'permission_denied_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileErrorResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileErrorResult(%r, %r)' % (self._tag, self._value)
FileErrorResult_validator = bv.Union(FileErrorResult)
2019-08-28 21:48:24 +02:00
class SharedLinkMetadata(bb.Struct):
"""
The metadata of a shared link.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedLinkMetadata.url: URL of the shared link.
:ivar sharing.SharedLinkMetadata.id: A unique identifier for the linked
file.
:ivar sharing.SharedLinkMetadata.name: The linked file name (including
extension). This never contains a slash.
:ivar sharing.SharedLinkMetadata.expires: Expiration time, if set. By
default the link won't expire.
:ivar sharing.SharedLinkMetadata.path_lower: The lowercased full path in the
user's Dropbox. This always starts with a slash. This field will only be
present only if the linked file is in the authenticated user's dropbox.
:ivar sharing.SharedLinkMetadata.link_permissions: The link's access
permissions.
:ivar sharing.SharedLinkMetadata.team_member_info: The team membership
information of the link's owner. This field will only be present if
the link's owner is a team member.
:ivar sharing.SharedLinkMetadata.content_owner_team_info: The team
information of the content's owner. This field will only be present if
the content's owner is a team member and the content's owner team is
different from the link's owner team.
"""
__slots__ = [
'_url_value',
'_url_present',
'_id_value',
'_id_present',
'_name_value',
'_name_present',
'_expires_value',
'_expires_present',
'_path_lower_value',
'_path_lower_present',
'_link_permissions_value',
'_link_permissions_present',
'_team_member_info_value',
'_team_member_info_present',
'_content_owner_team_info_value',
'_content_owner_team_info_present',
]
_has_required_fields = True
def __init__(self,
url=None,
name=None,
link_permissions=None,
id=None,
expires=None,
path_lower=None,
team_member_info=None,
content_owner_team_info=None):
self._url_value = None
self._url_present = False
self._id_value = None
self._id_present = False
self._name_value = None
self._name_present = False
self._expires_value = None
self._expires_present = False
self._path_lower_value = None
self._path_lower_present = False
self._link_permissions_value = None
self._link_permissions_present = False
self._team_member_info_value = None
self._team_member_info_present = False
self._content_owner_team_info_value = None
self._content_owner_team_info_present = False
if url is not None:
self.url = url
if id is not None:
self.id = id
if name is not None:
self.name = name
if expires is not None:
self.expires = expires
if path_lower is not None:
self.path_lower = path_lower
if link_permissions is not None:
self.link_permissions = link_permissions
if team_member_info is not None:
self.team_member_info = team_member_info
if content_owner_team_info is not None:
self.content_owner_team_info = content_owner_team_info
@property
def url(self):
"""
URL of the shared link.
:rtype: str
"""
if self._url_present:
return self._url_value
else:
raise AttributeError("missing required field 'url'")
@url.setter
def url(self, val):
val = self._url_validator.validate(val)
self._url_value = val
self._url_present = True
@url.deleter
def url(self):
self._url_value = None
self._url_present = False
@property
def id(self):
"""
A unique identifier for the linked file.
:rtype: str
"""
if self._id_present:
return self._id_value
else:
return None
@id.setter
def id(self, val):
if val is None:
del self.id
return
val = self._id_validator.validate(val)
self._id_value = val
self._id_present = True
@id.deleter
def id(self):
self._id_value = None
self._id_present = False
@property
def name(self):
"""
The linked file name (including extension). This never contains a slash.
:rtype: str
"""
if self._name_present:
return self._name_value
else:
raise AttributeError("missing required field 'name'")
@name.setter
def name(self, val):
val = self._name_validator.validate(val)
self._name_value = val
self._name_present = True
@name.deleter
def name(self):
self._name_value = None
self._name_present = False
@property
def expires(self):
"""
Expiration time, if set. By default the link won't expire.
:rtype: datetime.datetime
"""
if self._expires_present:
return self._expires_value
else:
return None
@expires.setter
def expires(self, val):
if val is None:
del self.expires
return
val = self._expires_validator.validate(val)
self._expires_value = val
self._expires_present = True
@expires.deleter
def expires(self):
self._expires_value = None
self._expires_present = False
@property
def path_lower(self):
"""
The lowercased full path in the user's Dropbox. This always starts with
a slash. This field will only be present only if the linked file is in
the authenticated user's dropbox.
:rtype: str
"""
if self._path_lower_present:
return self._path_lower_value
else:
return None
@path_lower.setter
def path_lower(self, val):
if val is None:
del self.path_lower
return
val = self._path_lower_validator.validate(val)
self._path_lower_value = val
self._path_lower_present = True
@path_lower.deleter
def path_lower(self):
self._path_lower_value = None
self._path_lower_present = False
@property
def link_permissions(self):
"""
The link's access permissions.
:rtype: LinkPermissions
"""
if self._link_permissions_present:
return self._link_permissions_value
else:
raise AttributeError("missing required field 'link_permissions'")
@link_permissions.setter
def link_permissions(self, val):
self._link_permissions_validator.validate_type_only(val)
self._link_permissions_value = val
self._link_permissions_present = True
@link_permissions.deleter
def link_permissions(self):
self._link_permissions_value = None
self._link_permissions_present = False
@property
def team_member_info(self):
"""
The team membership information of the link's owner. This field will
only be present if the link's owner is a team member.
:rtype: TeamMemberInfo
"""
if self._team_member_info_present:
return self._team_member_info_value
else:
return None
@team_member_info.setter
def team_member_info(self, val):
if val is None:
del self.team_member_info
return
self._team_member_info_validator.validate_type_only(val)
self._team_member_info_value = val
self._team_member_info_present = True
@team_member_info.deleter
def team_member_info(self):
self._team_member_info_value = None
self._team_member_info_present = False
@property
def content_owner_team_info(self):
"""
The team information of the content's owner. This field will only be
present if the content's owner is a team member and the content's owner
team is different from the link's owner team.
2019-08-28 21:48:24 +02:00
:rtype: users.Team
"""
if self._content_owner_team_info_present:
return self._content_owner_team_info_value
else:
return None
@content_owner_team_info.setter
def content_owner_team_info(self, val):
if val is None:
del self.content_owner_team_info
return
val = self._content_owner_team_info_validator.validate(val)
self._content_owner_team_info_value = val
self._content_owner_team_info_present = True
@content_owner_team_info.deleter
def content_owner_team_info(self):
self._content_owner_team_info_value = None
self._content_owner_team_info_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedLinkMetadata(url={!r}, name={!r}, link_permissions={!r}, id={!r}, expires={!r}, path_lower={!r}, team_member_info={!r}, content_owner_team_info={!r})'.format(
self._url_value,
self._name_value,
self._link_permissions_value,
self._id_value,
self._expires_value,
self._path_lower_value,
self._team_member_info_value,
self._content_owner_team_info_value,
)
SharedLinkMetadata_validator = bv.StructTree(SharedLinkMetadata)
class FileLinkMetadata(SharedLinkMetadata):
"""
The metadata of a file shared link.
2019-08-28 21:48:24 +02:00
:ivar sharing.FileLinkMetadata.client_modified: The modification time set by
the desktop client when the file was added to Dropbox. Since this time
is not verified (the Dropbox server stores whatever the desktop client
sends up), this should only be used for display purposes (such as
sorting) and not, for example, to determine if a file has changed or
not.
:ivar sharing.FileLinkMetadata.server_modified: The last time the file was
modified on Dropbox.
:ivar sharing.FileLinkMetadata.rev: A unique identifier for the current
revision of a file. This field is the same rev as elsewhere in the API
and can be used to detect changes and avoid conflicts.
:ivar sharing.FileLinkMetadata.size: The file size in bytes.
"""
__slots__ = [
'_client_modified_value',
'_client_modified_present',
'_server_modified_value',
'_server_modified_present',
'_rev_value',
'_rev_present',
'_size_value',
'_size_present',
]
_has_required_fields = True
def __init__(self,
url=None,
name=None,
link_permissions=None,
client_modified=None,
server_modified=None,
rev=None,
size=None,
id=None,
expires=None,
path_lower=None,
team_member_info=None,
content_owner_team_info=None):
super(FileLinkMetadata, self).__init__(url,
name,
link_permissions,
id,
expires,
path_lower,
team_member_info,
content_owner_team_info)
self._client_modified_value = None
self._client_modified_present = False
self._server_modified_value = None
self._server_modified_present = False
self._rev_value = None
self._rev_present = False
self._size_value = None
self._size_present = False
if client_modified is not None:
self.client_modified = client_modified
if server_modified is not None:
self.server_modified = server_modified
if rev is not None:
self.rev = rev
if size is not None:
self.size = size
@property
def client_modified(self):
"""
The modification time set by the desktop client when the file was added
to Dropbox. Since this time is not verified (the Dropbox server stores
whatever the desktop client sends up), this should only be used for
display purposes (such as sorting) and not, for example, to determine if
a file has changed or not.
:rtype: datetime.datetime
"""
if self._client_modified_present:
return self._client_modified_value
else:
raise AttributeError("missing required field 'client_modified'")
@client_modified.setter
def client_modified(self, val):
val = self._client_modified_validator.validate(val)
self._client_modified_value = val
self._client_modified_present = True
@client_modified.deleter
def client_modified(self):
self._client_modified_value = None
self._client_modified_present = False
@property
def server_modified(self):
"""
The last time the file was modified on Dropbox.
:rtype: datetime.datetime
"""
if self._server_modified_present:
return self._server_modified_value
else:
raise AttributeError("missing required field 'server_modified'")
@server_modified.setter
def server_modified(self, val):
val = self._server_modified_validator.validate(val)
self._server_modified_value = val
self._server_modified_present = True
@server_modified.deleter
def server_modified(self):
self._server_modified_value = None
self._server_modified_present = False
@property
def rev(self):
"""
A unique identifier for the current revision of a file. This field is
the same rev as elsewhere in the API and can be used to detect changes
and avoid conflicts.
:rtype: str
"""
if self._rev_present:
return self._rev_value
else:
raise AttributeError("missing required field 'rev'")
@rev.setter
def rev(self, val):
val = self._rev_validator.validate(val)
self._rev_value = val
self._rev_present = True
@rev.deleter
def rev(self):
self._rev_value = None
self._rev_present = False
@property
def size(self):
"""
The file size in bytes.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._size_present:
return self._size_value
else:
raise AttributeError("missing required field 'size'")
@size.setter
def size(self, val):
val = self._size_validator.validate(val)
self._size_value = val
self._size_present = True
@size.deleter
def size(self):
self._size_value = None
self._size_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileLinkMetadata(url={!r}, name={!r}, link_permissions={!r}, client_modified={!r}, server_modified={!r}, rev={!r}, size={!r}, id={!r}, expires={!r}, path_lower={!r}, team_member_info={!r}, content_owner_team_info={!r})'.format(
self._url_value,
self._name_value,
self._link_permissions_value,
self._client_modified_value,
self._server_modified_value,
self._rev_value,
self._size_value,
self._id_value,
self._expires_value,
self._path_lower_value,
self._team_member_info_value,
self._content_owner_team_info_value,
)
FileLinkMetadata_validator = bv.Struct(FileLinkMetadata)
class FileMemberActionError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.FileMemberActionError.invalid_member: Specified member was not
found.
:ivar sharing.FileMemberActionError.no_permission: User does not have
permission to perform this action on this member.
:ivar SharingFileAccessError FileMemberActionError.access_error: Specified
file was invalid or user does not have access.
:ivar MemberAccessLevelResult FileMemberActionError.no_explicit_access: The
action cannot be completed because the target member does not have
explicit access to the file. The return value is the access that the
member has to the file from a parent folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_member = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: FileMemberActionError
"""
return cls('access_error', val)
@classmethod
def no_explicit_access(cls, val):
"""
Create an instance of this class set to the ``no_explicit_access`` tag
with value ``val``.
:param MemberAccessLevelResult val:
:rtype: FileMemberActionError
"""
return cls('no_explicit_access', val)
def is_invalid_member(self):
"""
Check if the union tag is ``invalid_member``.
:rtype: bool
"""
return self._tag == 'invalid_member'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_no_explicit_access(self):
"""
Check if the union tag is ``no_explicit_access``.
:rtype: bool
"""
return self._tag == 'no_explicit_access'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Specified file was invalid or user does not have access.
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def get_no_explicit_access(self):
"""
The action cannot be completed because the target member does not have
explicit access to the file. The return value is the access that the
member has to the file from a parent folder.
Only call this if :meth:`is_no_explicit_access` is true.
:rtype: MemberAccessLevelResult
"""
if not self.is_no_explicit_access():
raise AttributeError("tag 'no_explicit_access' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileMemberActionError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileMemberActionError(%r, %r)' % (self._tag, self._value)
FileMemberActionError_validator = bv.Union(FileMemberActionError)
class FileMemberActionIndividualResult(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.
2019-08-28 21:48:24 +02:00
:ivar Optional[AccessLevel]
sharing.FileMemberActionIndividualResult.success: Member was
successfully removed from this 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.
"""
_catch_all = None
@classmethod
def success(cls, val):
"""
Create an instance of this class set to the ``success`` tag with value
``val``.
:param AccessLevel val:
:rtype: FileMemberActionIndividualResult
"""
return cls('success', val)
@classmethod
def member_error(cls, val):
"""
Create an instance of this class set to the ``member_error`` tag with
value ``val``.
:param FileMemberActionError val:
:rtype: FileMemberActionIndividualResult
"""
return cls('member_error', val)
def is_success(self):
"""
Check if the union tag is ``success``.
:rtype: bool
"""
return self._tag == 'success'
def is_member_error(self):
"""
Check if the union tag is ``member_error``.
:rtype: bool
"""
return self._tag == 'member_error'
def get_success(self):
"""
Member was successfully removed from this file. If AccessLevel is given,
the member still has access via a parent shared folder.
Only call this if :meth:`is_success` is true.
:rtype: AccessLevel
"""
if not self.is_success():
raise AttributeError("tag 'success' not set")
return self._value
def get_member_error(self):
"""
User was not able to perform this action.
Only call this if :meth:`is_member_error` is true.
:rtype: FileMemberActionError
"""
if not self.is_member_error():
raise AttributeError("tag 'member_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileMemberActionIndividualResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileMemberActionIndividualResult(%r, %r)' % (self._tag, self._value)
FileMemberActionIndividualResult_validator = bv.Union(FileMemberActionIndividualResult)
2019-08-28 21:48:24 +02:00
class FileMemberActionResult(bb.Struct):
"""
Per-member result for
:meth:`dropbox.dropbox.Dropbox.sharing_add_file_member` or
:meth:`dropbox.dropbox.Dropbox.sharing_change_file_member_access`.
2019-08-28 21:48:24 +02:00
:ivar sharing.FileMemberActionResult.member: One of specified input members.
:ivar sharing.FileMemberActionResult.result: The outcome of the action on
this member.
"""
__slots__ = [
'_member_value',
'_member_present',
'_result_value',
'_result_present',
]
_has_required_fields = True
def __init__(self,
member=None,
result=None):
self._member_value = None
self._member_present = False
self._result_value = None
self._result_present = False
if member is not None:
self.member = member
if result is not None:
self.result = result
@property
def member(self):
"""
One of specified input members.
:rtype: MemberSelector
"""
if self._member_present:
return self._member_value
else:
raise AttributeError("missing required field 'member'")
@member.setter
def member(self, val):
self._member_validator.validate_type_only(val)
self._member_value = val
self._member_present = True
@member.deleter
def member(self):
self._member_value = None
self._member_present = False
@property
def result(self):
"""
The outcome of the action on this member.
:rtype: FileMemberActionIndividualResult
"""
if self._result_present:
return self._result_value
else:
raise AttributeError("missing required field 'result'")
@result.setter
def result(self, val):
self._result_validator.validate_type_only(val)
self._result_value = val
self._result_present = True
@result.deleter
def result(self):
self._result_value = None
self._result_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileMemberActionResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileMemberActionResult(member={!r}, result={!r})'.format(
self._member_value,
self._result_value,
)
FileMemberActionResult_validator = bv.Struct(FileMemberActionResult)
class FileMemberRemoveActionResult(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.
2019-08-28 21:48:24 +02:00
:ivar MemberAccessLevelResult FileMemberRemoveActionResult.success: Member
was successfully removed from this file.
:ivar FileMemberActionError FileMemberRemoveActionResult.member_error: User
was not able to remove this member.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def success(cls, val):
"""
Create an instance of this class set to the ``success`` tag with value
``val``.
:param MemberAccessLevelResult val:
:rtype: FileMemberRemoveActionResult
"""
return cls('success', val)
@classmethod
def member_error(cls, val):
"""
Create an instance of this class set to the ``member_error`` tag with
value ``val``.
:param FileMemberActionError val:
:rtype: FileMemberRemoveActionResult
"""
return cls('member_error', val)
def is_success(self):
"""
Check if the union tag is ``success``.
:rtype: bool
"""
return self._tag == 'success'
def is_member_error(self):
"""
Check if the union tag is ``member_error``.
:rtype: bool
"""
return self._tag == 'member_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_success(self):
"""
Member was successfully removed from this file.
Only call this if :meth:`is_success` is true.
:rtype: MemberAccessLevelResult
"""
if not self.is_success():
raise AttributeError("tag 'success' not set")
return self._value
def get_member_error(self):
"""
User was not able to remove this member.
Only call this if :meth:`is_member_error` is true.
:rtype: FileMemberActionError
"""
if not self.is_member_error():
raise AttributeError("tag 'member_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FileMemberRemoveActionResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FileMemberRemoveActionResult(%r, %r)' % (self._tag, self._value)
FileMemberRemoveActionResult_validator = bv.Union(FileMemberRemoveActionResult)
2019-08-28 21:48:24 +02:00
class FilePermission(bb.Struct):
"""
Whether the user is allowed to take the sharing action on the file.
2019-08-28 21:48:24 +02:00
:ivar sharing.FilePermission.action: The action that the user may wish to
take on the file.
:ivar sharing.FilePermission.allow: True if the user is allowed to take the
action.
:ivar sharing.FilePermission.reason: The reason why the user is denied the
permission. Not present if the action is allowed.
"""
__slots__ = [
'_action_value',
'_action_present',
'_allow_value',
'_allow_present',
'_reason_value',
'_reason_present',
]
_has_required_fields = True
def __init__(self,
action=None,
allow=None,
reason=None):
self._action_value = None
self._action_present = False
self._allow_value = None
self._allow_present = False
self._reason_value = None
self._reason_present = False
if action is not None:
self.action = action
if allow is not None:
self.allow = allow
if reason is not None:
self.reason = reason
@property
def action(self):
"""
The action that the user may wish to take on the file.
:rtype: FileAction
"""
if self._action_present:
return self._action_value
else:
raise AttributeError("missing required field 'action'")
@action.setter
def action(self, val):
self._action_validator.validate_type_only(val)
self._action_value = val
self._action_present = True
@action.deleter
def action(self):
self._action_value = None
self._action_present = False
@property
def allow(self):
"""
True if the user is allowed to take the action.
:rtype: bool
"""
if self._allow_present:
return self._allow_value
else:
raise AttributeError("missing required field 'allow'")
@allow.setter
def allow(self, val):
val = self._allow_validator.validate(val)
self._allow_value = val
self._allow_present = True
@allow.deleter
def allow(self):
self._allow_value = None
self._allow_present = False
@property
def reason(self):
"""
The reason why the user is denied the permission. Not present if the
action is allowed.
:rtype: PermissionDeniedReason
"""
if self._reason_present:
return self._reason_value
else:
return None
@reason.setter
def reason(self, val):
if val is None:
del self.reason
return
self._reason_validator.validate_type_only(val)
self._reason_value = val
self._reason_present = True
@reason.deleter
def reason(self):
self._reason_value = None
self._reason_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FilePermission, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FilePermission(action={!r}, allow={!r}, reason={!r})'.format(
self._action_value,
self._allow_value,
self._reason_value,
)
FilePermission_validator = bv.Struct(FilePermission)
class FolderAction(bb.Union):
"""
Actions that may be taken on shared folders.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.FolderAction.change_options: Change folder options, such as
who can be invited to join the folder.
:ivar sharing.FolderAction.disable_viewer_info: Disable viewer information
for this folder.
:ivar sharing.FolderAction.edit_contents: Change or edit contents of the
folder.
:ivar sharing.FolderAction.enable_viewer_info: Enable viewer information on
the folder.
:ivar sharing.FolderAction.invite_editor: Invite a user or group to join the
folder with read and write permission.
:ivar sharing.FolderAction.invite_viewer: Invite a user or group to join the
folder with read permission.
:ivar sharing.FolderAction.invite_viewer_no_comment: Invite a user or group
to join the folder with read permission but no comment permissions.
:ivar sharing.FolderAction.relinquish_membership: Relinquish one's own
membership in the folder.
:ivar sharing.FolderAction.unmount: Unmount the folder.
:ivar sharing.FolderAction.unshare: Stop sharing this folder.
:ivar sharing.FolderAction.leave_a_copy: Keep a copy of the contents upon
leaving or being kicked from the folder.
:ivar sharing.FolderAction.share_link: Use create_link instead.
:ivar sharing.FolderAction.create_link: Create a shared link for folder.
:ivar sharing.FolderAction.set_access_inheritance: Set whether the folder
inherits permissions from its parent.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
change_options = None
# Attribute is overwritten below the class definition
disable_viewer_info = None
# Attribute is overwritten below the class definition
edit_contents = None
# Attribute is overwritten below the class definition
enable_viewer_info = None
# Attribute is overwritten below the class definition
invite_editor = None
# Attribute is overwritten below the class definition
invite_viewer = None
# Attribute is overwritten below the class definition
invite_viewer_no_comment = None
# Attribute is overwritten below the class definition
relinquish_membership = None
# Attribute is overwritten below the class definition
unmount = None
# Attribute is overwritten below the class definition
unshare = None
# Attribute is overwritten below the class definition
leave_a_copy = None
# Attribute is overwritten below the class definition
share_link = None
# Attribute is overwritten below the class definition
create_link = None
# Attribute is overwritten below the class definition
2019-08-28 21:48:24 +02:00
set_access_inheritance = None
# Attribute is overwritten below the class definition
other = None
def is_change_options(self):
"""
Check if the union tag is ``change_options``.
:rtype: bool
"""
return self._tag == 'change_options'
def is_disable_viewer_info(self):
"""
Check if the union tag is ``disable_viewer_info``.
:rtype: bool
"""
return self._tag == 'disable_viewer_info'
def is_edit_contents(self):
"""
Check if the union tag is ``edit_contents``.
:rtype: bool
"""
return self._tag == 'edit_contents'
def is_enable_viewer_info(self):
"""
Check if the union tag is ``enable_viewer_info``.
:rtype: bool
"""
return self._tag == 'enable_viewer_info'
def is_invite_editor(self):
"""
Check if the union tag is ``invite_editor``.
:rtype: bool
"""
return self._tag == 'invite_editor'
def is_invite_viewer(self):
"""
Check if the union tag is ``invite_viewer``.
:rtype: bool
"""
return self._tag == 'invite_viewer'
def is_invite_viewer_no_comment(self):
"""
Check if the union tag is ``invite_viewer_no_comment``.
:rtype: bool
"""
return self._tag == 'invite_viewer_no_comment'
def is_relinquish_membership(self):
"""
Check if the union tag is ``relinquish_membership``.
:rtype: bool
"""
return self._tag == 'relinquish_membership'
def is_unmount(self):
"""
Check if the union tag is ``unmount``.
:rtype: bool
"""
return self._tag == 'unmount'
def is_unshare(self):
"""
Check if the union tag is ``unshare``.
:rtype: bool
"""
return self._tag == 'unshare'
def is_leave_a_copy(self):
"""
Check if the union tag is ``leave_a_copy``.
:rtype: bool
"""
return self._tag == 'leave_a_copy'
def is_share_link(self):
"""
Check if the union tag is ``share_link``.
:rtype: bool
"""
return self._tag == 'share_link'
def is_create_link(self):
"""
Check if the union tag is ``create_link``.
:rtype: bool
"""
return self._tag == 'create_link'
2019-08-28 21:48:24 +02:00
def is_set_access_inheritance(self):
"""
Check if the union tag is ``set_access_inheritance``.
:rtype: bool
"""
return self._tag == 'set_access_inheritance'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FolderAction, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FolderAction(%r, %r)' % (self._tag, self._value)
FolderAction_validator = bv.Union(FolderAction)
class FolderLinkMetadata(SharedLinkMetadata):
"""
The metadata of a folder shared link.
"""
__slots__ = [
]
_has_required_fields = True
def __init__(self,
url=None,
name=None,
link_permissions=None,
id=None,
expires=None,
path_lower=None,
team_member_info=None,
content_owner_team_info=None):
super(FolderLinkMetadata, self).__init__(url,
name,
link_permissions,
id,
expires,
path_lower,
team_member_info,
content_owner_team_info)
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FolderLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FolderLinkMetadata(url={!r}, name={!r}, link_permissions={!r}, id={!r}, expires={!r}, path_lower={!r}, team_member_info={!r}, content_owner_team_info={!r})'.format(
self._url_value,
self._name_value,
self._link_permissions_value,
self._id_value,
self._expires_value,
self._path_lower_value,
self._team_member_info_value,
self._content_owner_team_info_value,
)
FolderLinkMetadata_validator = bv.Struct(FolderLinkMetadata)
2019-08-28 21:48:24 +02:00
class FolderPermission(bb.Struct):
"""
Whether the user is allowed to take the action on the shared folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.FolderPermission.action: The action that the user may wish to
take on the folder.
:ivar sharing.FolderPermission.allow: True if the user is allowed to take
the action.
:ivar sharing.FolderPermission.reason: The reason why the user is denied the
permission. Not present if the action is allowed, or if no reason is
available.
"""
__slots__ = [
'_action_value',
'_action_present',
'_allow_value',
'_allow_present',
'_reason_value',
'_reason_present',
]
_has_required_fields = True
def __init__(self,
action=None,
allow=None,
reason=None):
self._action_value = None
self._action_present = False
self._allow_value = None
self._allow_present = False
self._reason_value = None
self._reason_present = False
if action is not None:
self.action = action
if allow is not None:
self.allow = allow
if reason is not None:
self.reason = reason
@property
def action(self):
"""
The action that the user may wish to take on the folder.
:rtype: FolderAction
"""
if self._action_present:
return self._action_value
else:
raise AttributeError("missing required field 'action'")
@action.setter
def action(self, val):
self._action_validator.validate_type_only(val)
self._action_value = val
self._action_present = True
@action.deleter
def action(self):
self._action_value = None
self._action_present = False
@property
def allow(self):
"""
True if the user is allowed to take the action.
:rtype: bool
"""
if self._allow_present:
return self._allow_value
else:
raise AttributeError("missing required field 'allow'")
@allow.setter
def allow(self, val):
val = self._allow_validator.validate(val)
self._allow_value = val
self._allow_present = True
@allow.deleter
def allow(self):
self._allow_value = None
self._allow_present = False
@property
def reason(self):
"""
The reason why the user is denied the permission. Not present if the
action is allowed, or if no reason is available.
:rtype: PermissionDeniedReason
"""
if self._reason_present:
return self._reason_value
else:
return None
@reason.setter
def reason(self, val):
if val is None:
del self.reason
return
self._reason_validator.validate_type_only(val)
self._reason_value = val
self._reason_present = True
@reason.deleter
def reason(self):
self._reason_value = None
self._reason_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FolderPermission, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FolderPermission(action={!r}, allow={!r}, reason={!r})'.format(
self._action_value,
self._allow_value,
self._reason_value,
)
FolderPermission_validator = bv.Struct(FolderPermission)
2019-08-28 21:48:24 +02:00
class FolderPolicy(bb.Struct):
"""
A set of policies governing membership and privileges for a shared folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.FolderPolicy.member_policy: Who can be a member of this shared
folder, as set on the folder itself. The effective policy may differ
from this value if the team-wide policy is more restrictive. Present
only if the folder is owned by a team.
:ivar sharing.FolderPolicy.resolved_member_policy: Who can be a member of
this shared folder, taking into account both the folder and the
team-wide policy. This value may differ from that of member_policy if
the team-wide policy is more restrictive than the folder policy. Present
only if the folder is owned by a team.
:ivar sharing.FolderPolicy.acl_update_policy: Who can add and remove members
from this shared folder.
:ivar sharing.FolderPolicy.shared_link_policy: Who links can be shared with.
:ivar sharing.FolderPolicy.viewer_info_policy: Who can enable/disable viewer
info for this shared folder.
"""
__slots__ = [
'_member_policy_value',
'_member_policy_present',
'_resolved_member_policy_value',
'_resolved_member_policy_present',
'_acl_update_policy_value',
'_acl_update_policy_present',
'_shared_link_policy_value',
'_shared_link_policy_present',
'_viewer_info_policy_value',
'_viewer_info_policy_present',
]
_has_required_fields = True
def __init__(self,
acl_update_policy=None,
shared_link_policy=None,
member_policy=None,
resolved_member_policy=None,
viewer_info_policy=None):
self._member_policy_value = None
self._member_policy_present = False
self._resolved_member_policy_value = None
self._resolved_member_policy_present = False
self._acl_update_policy_value = None
self._acl_update_policy_present = False
self._shared_link_policy_value = None
self._shared_link_policy_present = False
self._viewer_info_policy_value = None
self._viewer_info_policy_present = False
if member_policy is not None:
self.member_policy = member_policy
if resolved_member_policy is not None:
self.resolved_member_policy = resolved_member_policy
if acl_update_policy is not None:
self.acl_update_policy = acl_update_policy
if shared_link_policy is not None:
self.shared_link_policy = shared_link_policy
if viewer_info_policy is not None:
self.viewer_info_policy = viewer_info_policy
@property
def member_policy(self):
"""
Who can be a member of this shared folder, as set on the folder itself.
The effective policy may differ from this value if the team-wide policy
is more restrictive. Present only if the folder is owned by a team.
:rtype: MemberPolicy
"""
if self._member_policy_present:
return self._member_policy_value
else:
return None
@member_policy.setter
def member_policy(self, val):
if val is None:
del self.member_policy
return
self._member_policy_validator.validate_type_only(val)
self._member_policy_value = val
self._member_policy_present = True
@member_policy.deleter
def member_policy(self):
self._member_policy_value = None
self._member_policy_present = False
@property
def resolved_member_policy(self):
"""
Who can be a member of this shared folder, taking into account both the
folder and the team-wide policy. This value may differ from that of
member_policy if the team-wide policy is more restrictive than the
folder policy. Present only if the folder is owned by a team.
:rtype: MemberPolicy
"""
if self._resolved_member_policy_present:
return self._resolved_member_policy_value
else:
return None
@resolved_member_policy.setter
def resolved_member_policy(self, val):
if val is None:
del self.resolved_member_policy
return
self._resolved_member_policy_validator.validate_type_only(val)
self._resolved_member_policy_value = val
self._resolved_member_policy_present = True
@resolved_member_policy.deleter
def resolved_member_policy(self):
self._resolved_member_policy_value = None
self._resolved_member_policy_present = False
@property
def acl_update_policy(self):
"""
Who can add and remove members from this shared folder.
:rtype: AclUpdatePolicy
"""
if self._acl_update_policy_present:
return self._acl_update_policy_value
else:
raise AttributeError("missing required field 'acl_update_policy'")
@acl_update_policy.setter
def acl_update_policy(self, val):
self._acl_update_policy_validator.validate_type_only(val)
self._acl_update_policy_value = val
self._acl_update_policy_present = True
@acl_update_policy.deleter
def acl_update_policy(self):
self._acl_update_policy_value = None
self._acl_update_policy_present = False
@property
def shared_link_policy(self):
"""
Who links can be shared with.
:rtype: SharedLinkPolicy
"""
if self._shared_link_policy_present:
return self._shared_link_policy_value
else:
raise AttributeError("missing required field 'shared_link_policy'")
@shared_link_policy.setter
def shared_link_policy(self, val):
self._shared_link_policy_validator.validate_type_only(val)
self._shared_link_policy_value = val
self._shared_link_policy_present = True
@shared_link_policy.deleter
def shared_link_policy(self):
self._shared_link_policy_value = None
self._shared_link_policy_present = False
@property
def viewer_info_policy(self):
"""
Who can enable/disable viewer info for this shared folder.
:rtype: ViewerInfoPolicy
"""
if self._viewer_info_policy_present:
return self._viewer_info_policy_value
else:
return None
@viewer_info_policy.setter
def viewer_info_policy(self, val):
if val is None:
del self.viewer_info_policy
return
self._viewer_info_policy_validator.validate_type_only(val)
self._viewer_info_policy_value = val
self._viewer_info_policy_present = True
@viewer_info_policy.deleter
def viewer_info_policy(self):
self._viewer_info_policy_value = None
self._viewer_info_policy_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(FolderPolicy, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'FolderPolicy(acl_update_policy={!r}, shared_link_policy={!r}, member_policy={!r}, resolved_member_policy={!r}, viewer_info_policy={!r})'.format(
self._acl_update_policy_value,
self._shared_link_policy_value,
self._member_policy_value,
self._resolved_member_policy_value,
self._viewer_info_policy_value,
)
FolderPolicy_validator = bv.Struct(FolderPolicy)
2019-08-28 21:48:24 +02:00
class GetFileMetadataArg(bb.Struct):
"""
Arguments of :meth:`dropbox.dropbox.Dropbox.sharing_get_file_metadata`.
2019-08-28 21:48:24 +02:00
:ivar sharing.GetFileMetadataArg.file: The file to query.
:ivar sharing.GetFileMetadataArg.actions: A list of `FileAction`s
corresponding to `FilePermission`s that should appear in the response's
``SharedFileMetadata.permissions`` field describing the actions the
authenticated user can perform on the file.
"""
__slots__ = [
'_file_value',
'_file_present',
'_actions_value',
'_actions_present',
]
_has_required_fields = True
def __init__(self,
file=None,
actions=None):
self._file_value = None
self._file_present = False
self._actions_value = None
self._actions_present = False
if file is not None:
self.file = file
if actions is not None:
self.actions = actions
@property
def file(self):
"""
The file to query.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def actions(self):
"""
A list of `FileAction`s corresponding to `FilePermission`s that should
appear in the response's ``SharedFileMetadata.permissions`` field
describing the actions the authenticated user can perform on the file.
:rtype: list of [FileAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetFileMetadataArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetFileMetadataArg(file={!r}, actions={!r})'.format(
self._file_value,
self._actions_value,
)
GetFileMetadataArg_validator = bv.Struct(GetFileMetadataArg)
2019-08-28 21:48:24 +02:00
class GetFileMetadataBatchArg(bb.Struct):
"""
Arguments of
:meth:`dropbox.dropbox.Dropbox.sharing_get_file_metadata_batch`.
2019-08-28 21:48:24 +02:00
:ivar sharing.GetFileMetadataBatchArg.files: The files to query.
:ivar sharing.GetFileMetadataBatchArg.actions: A list of `FileAction`s
corresponding to `FilePermission`s that should appear in the response's
``SharedFileMetadata.permissions`` field describing the actions the
authenticated user can perform on the file.
"""
__slots__ = [
'_files_value',
'_files_present',
'_actions_value',
'_actions_present',
]
_has_required_fields = True
def __init__(self,
files=None,
actions=None):
self._files_value = None
self._files_present = False
self._actions_value = None
self._actions_present = False
if files is not None:
self.files = files
if actions is not None:
self.actions = actions
@property
def files(self):
"""
The files to query.
:rtype: list of [str]
"""
if self._files_present:
return self._files_value
else:
raise AttributeError("missing required field 'files'")
@files.setter
def files(self, val):
val = self._files_validator.validate(val)
self._files_value = val
self._files_present = True
@files.deleter
def files(self):
self._files_value = None
self._files_present = False
@property
def actions(self):
"""
A list of `FileAction`s corresponding to `FilePermission`s that should
appear in the response's ``SharedFileMetadata.permissions`` field
describing the actions the authenticated user can perform on the file.
:rtype: list of [FileAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetFileMetadataBatchArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetFileMetadataBatchArg(files={!r}, actions={!r})'.format(
self._files_value,
self._actions_value,
)
GetFileMetadataBatchArg_validator = bv.Struct(GetFileMetadataBatchArg)
2019-08-28 21:48:24 +02:00
class GetFileMetadataBatchResult(bb.Struct):
"""
Per file results of
:meth:`dropbox.dropbox.Dropbox.sharing_get_file_metadata_batch`.
2019-08-28 21:48:24 +02:00
:ivar sharing.GetFileMetadataBatchResult.file: This is the input file
identifier corresponding to one of ``GetFileMetadataBatchArg.files``.
:ivar sharing.GetFileMetadataBatchResult.result: The result for this
particular file.
"""
__slots__ = [
'_file_value',
'_file_present',
'_result_value',
'_result_present',
]
_has_required_fields = True
def __init__(self,
file=None,
result=None):
self._file_value = None
self._file_present = False
self._result_value = None
self._result_present = False
if file is not None:
self.file = file
if result is not None:
self.result = result
@property
def file(self):
"""
This is the input file identifier corresponding to one of
``GetFileMetadataBatchArg.files``.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def result(self):
"""
The result for this particular file.
:rtype: GetFileMetadataIndividualResult
"""
if self._result_present:
return self._result_value
else:
raise AttributeError("missing required field 'result'")
@result.setter
def result(self, val):
self._result_validator.validate_type_only(val)
self._result_value = val
self._result_present = True
@result.deleter
def result(self):
self._result_value = None
self._result_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetFileMetadataBatchResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetFileMetadataBatchResult(file={!r}, result={!r})'.format(
self._file_value,
self._result_value,
)
GetFileMetadataBatchResult_validator = bv.Struct(GetFileMetadataBatchResult)
class GetFileMetadataError(bb.Union):
"""
Error result for :meth:`dropbox.dropbox.Dropbox.sharing_get_file_metadata`.
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 user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: GetFileMetadataError
"""
return cls('user_error', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: GetFileMetadataError
"""
return cls('access_error', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetFileMetadataError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetFileMetadataError(%r, %r)' % (self._tag, self._value)
GetFileMetadataError_validator = bv.Union(GetFileMetadataError)
class GetFileMetadataIndividualResult(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.
2019-08-28 21:48:24 +02:00
:ivar SharedFileMetadata GetFileMetadataIndividualResult.metadata: The
result for this file if it was successful.
:ivar SharingFileAccessError GetFileMetadataIndividualResult.access_error:
The result for this file if it was an error.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def metadata(cls, val):
"""
Create an instance of this class set to the ``metadata`` tag with value
``val``.
:param SharedFileMetadata val:
:rtype: GetFileMetadataIndividualResult
"""
return cls('metadata', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: GetFileMetadataIndividualResult
"""
return cls('access_error', val)
def is_metadata(self):
"""
Check if the union tag is ``metadata``.
:rtype: bool
"""
return self._tag == 'metadata'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_metadata(self):
"""
The result for this file if it was successful.
Only call this if :meth:`is_metadata` is true.
:rtype: SharedFileMetadata
"""
if not self.is_metadata():
raise AttributeError("tag 'metadata' not set")
return self._value
def get_access_error(self):
"""
The result for this file if it was an error.
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetFileMetadataIndividualResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetFileMetadataIndividualResult(%r, %r)' % (self._tag, self._value)
GetFileMetadataIndividualResult_validator = bv.Union(GetFileMetadataIndividualResult)
2019-08-28 21:48:24 +02:00
class GetMetadataArgs(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.GetMetadataArgs.shared_folder_id: The ID for the shared
folder.
:ivar sharing.GetMetadataArgs.actions: A list of `FolderAction`s
corresponding to `FolderPermission`s that should appear in the
response's ``SharedFolderMetadata.permissions`` field describing the
actions the authenticated user can perform on the folder.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_actions_value',
'_actions_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
actions=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._actions_value = None
self._actions_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if actions is not None:
self.actions = actions
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def actions(self):
"""
A list of `FolderAction`s corresponding to `FolderPermission`s that
should appear in the response's ``SharedFolderMetadata.permissions``
field describing the actions the authenticated user can perform on the
folder.
:rtype: list of [FolderAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetMetadataArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetMetadataArgs(shared_folder_id={!r}, actions={!r})'.format(
self._shared_folder_id_value,
self._actions_value,
)
GetMetadataArgs_validator = bv.Struct(GetMetadataArgs)
class SharedLinkError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedLinkError.shared_link_not_found: The shared link wasn't
found.
:ivar sharing.SharedLinkError.shared_link_access_denied: The caller is not
allowed to access this shared link.
:ivar sharing.SharedLinkError.unsupported_link_type: This type of link is
not supported; use :meth:`dropbox.dropbox.Dropbox.sharing_files`
instead.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
shared_link_not_found = None
# Attribute is overwritten below the class definition
shared_link_access_denied = None
# Attribute is overwritten below the class definition
unsupported_link_type = None
# Attribute is overwritten below the class definition
other = None
def is_shared_link_not_found(self):
"""
Check if the union tag is ``shared_link_not_found``.
:rtype: bool
"""
return self._tag == 'shared_link_not_found'
def is_shared_link_access_denied(self):
"""
Check if the union tag is ``shared_link_access_denied``.
:rtype: bool
"""
return self._tag == 'shared_link_access_denied'
def is_unsupported_link_type(self):
"""
Check if the union tag is ``unsupported_link_type``.
:rtype: bool
"""
return self._tag == 'unsupported_link_type'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedLinkError(%r, %r)' % (self._tag, self._value)
SharedLinkError_validator = bv.Union(SharedLinkError)
class GetSharedLinkFileError(SharedLinkError):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.GetSharedLinkFileError.shared_link_is_directory: Directories
cannot be retrieved by this endpoint.
"""
# Attribute is overwritten below the class definition
shared_link_is_directory = None
def is_shared_link_is_directory(self):
"""
Check if the union tag is ``shared_link_is_directory``.
:rtype: bool
"""
return self._tag == 'shared_link_is_directory'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetSharedLinkFileError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetSharedLinkFileError(%r, %r)' % (self._tag, self._value)
GetSharedLinkFileError_validator = bv.Union(GetSharedLinkFileError)
2019-08-28 21:48:24 +02:00
class GetSharedLinkMetadataArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.GetSharedLinkMetadataArg.url: URL of the shared link.
:ivar sharing.GetSharedLinkMetadataArg.path: If the shared link is to a
folder, this parameter can be used to retrieve the metadata for a
specific file or sub-folder in this folder. A relative path should be
used.
:ivar sharing.GetSharedLinkMetadataArg.link_password: If the shared link has
a password, this parameter can be used.
"""
__slots__ = [
'_url_value',
'_url_present',
'_path_value',
'_path_present',
'_link_password_value',
'_link_password_present',
]
_has_required_fields = True
def __init__(self,
url=None,
path=None,
link_password=None):
self._url_value = None
self._url_present = False
self._path_value = None
self._path_present = False
self._link_password_value = None
self._link_password_present = False
if url is not None:
self.url = url
if path is not None:
self.path = path
if link_password is not None:
self.link_password = link_password
@property
def url(self):
"""
URL of the shared link.
:rtype: str
"""
if self._url_present:
return self._url_value
else:
raise AttributeError("missing required field 'url'")
@url.setter
def url(self, val):
val = self._url_validator.validate(val)
self._url_value = val
self._url_present = True
@url.deleter
def url(self):
self._url_value = None
self._url_present = False
@property
def path(self):
"""
If the shared link is to a folder, this parameter can be used to
retrieve the metadata for a specific file or sub-folder in this folder.
A relative path should be used.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
return None
@path.setter
def path(self, val):
if val is None:
del self.path
return
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
@property
def link_password(self):
"""
If the shared link has a password, this parameter can be used.
:rtype: str
"""
if self._link_password_present:
return self._link_password_value
else:
return None
@link_password.setter
def link_password(self, val):
if val is None:
del self.link_password
return
val = self._link_password_validator.validate(val)
self._link_password_value = val
self._link_password_present = True
@link_password.deleter
def link_password(self):
self._link_password_value = None
self._link_password_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetSharedLinkMetadataArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetSharedLinkMetadataArg(url={!r}, path={!r}, link_password={!r})'.format(
self._url_value,
self._path_value,
self._link_password_value,
)
GetSharedLinkMetadataArg_validator = bv.Struct(GetSharedLinkMetadataArg)
2019-08-28 21:48:24 +02:00
class GetSharedLinksArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.GetSharedLinksArg.path: See
:meth:`dropbox.dropbox.Dropbox.sharing_get_shared_links` description.
"""
__slots__ = [
'_path_value',
'_path_present',
]
_has_required_fields = False
def __init__(self,
path=None):
self._path_value = None
self._path_present = False
if path is not None:
self.path = path
@property
def path(self):
"""
See :meth:`dropbox.dropbox.Dropbox.sharing_get_shared_links`
description.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
return None
@path.setter
def path(self, val):
if val is None:
del self.path
return
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetSharedLinksArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetSharedLinksArg(path={!r})'.format(
self._path_value,
)
GetSharedLinksArg_validator = bv.Struct(GetSharedLinksArg)
class GetSharedLinksError(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 path(cls, val):
"""
Create an instance of this class set to the ``path`` tag with value
``val``.
:param Optional[str] val:
:rtype: GetSharedLinksError
"""
return cls('path', val)
def is_path(self):
"""
Check if the union tag is ``path``.
:rtype: bool
"""
return self._tag == 'path'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_path(self):
"""
Only call this if :meth:`is_path` is true.
:rtype: Optional[str]
"""
if not self.is_path():
raise AttributeError("tag 'path' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetSharedLinksError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetSharedLinksError(%r, %r)' % (self._tag, self._value)
GetSharedLinksError_validator = bv.Union(GetSharedLinksError)
2019-08-28 21:48:24 +02:00
class GetSharedLinksResult(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.GetSharedLinksResult.links: Shared links applicable to the
path argument.
"""
__slots__ = [
'_links_value',
'_links_present',
]
_has_required_fields = True
def __init__(self,
links=None):
self._links_value = None
self._links_present = False
if links is not None:
self.links = links
@property
def links(self):
"""
Shared links applicable to the path argument.
:rtype: list of [LinkMetadata]
"""
if self._links_present:
return self._links_value
else:
raise AttributeError("missing required field 'links'")
@links.setter
def links(self, val):
val = self._links_validator.validate(val)
self._links_value = val
self._links_present = True
@links.deleter
def links(self):
self._links_value = None
self._links_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GetSharedLinksResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GetSharedLinksResult(links={!r})'.format(
self._links_value,
)
GetSharedLinksResult_validator = bv.Struct(GetSharedLinksResult)
class GroupInfo(team_common.GroupSummary):
"""
The information about a group. Groups is a way to manage a list of users
who need same access permission to the shared folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.GroupInfo.group_type: The type of group.
:ivar sharing.GroupInfo.is_member: If the current user is a member of the
group.
:ivar sharing.GroupInfo.is_owner: If the current user is an owner of the
group.
:ivar sharing.GroupInfo.same_team: If the group is owned by the current
user's team.
"""
__slots__ = [
'_group_type_value',
'_group_type_present',
'_is_member_value',
'_is_member_present',
'_is_owner_value',
'_is_owner_present',
'_same_team_value',
'_same_team_present',
]
_has_required_fields = True
def __init__(self,
group_name=None,
group_id=None,
group_management_type=None,
group_type=None,
is_member=None,
is_owner=None,
same_team=None,
group_external_id=None,
member_count=None):
super(GroupInfo, self).__init__(group_name,
group_id,
group_management_type,
group_external_id,
member_count)
self._group_type_value = None
self._group_type_present = False
self._is_member_value = None
self._is_member_present = False
self._is_owner_value = None
self._is_owner_present = False
self._same_team_value = None
self._same_team_present = False
if group_type is not None:
self.group_type = group_type
if is_member is not None:
self.is_member = is_member
if is_owner is not None:
self.is_owner = is_owner
if same_team is not None:
self.same_team = same_team
@property
def group_type(self):
"""
The type of group.
2019-08-28 21:48:24 +02:00
:rtype: team_common.GroupType
"""
if self._group_type_present:
return self._group_type_value
else:
raise AttributeError("missing required field 'group_type'")
@group_type.setter
def group_type(self, val):
self._group_type_validator.validate_type_only(val)
self._group_type_value = val
self._group_type_present = True
@group_type.deleter
def group_type(self):
self._group_type_value = None
self._group_type_present = False
@property
def is_member(self):
"""
If the current user is a member of the group.
:rtype: bool
"""
if self._is_member_present:
return self._is_member_value
else:
raise AttributeError("missing required field 'is_member'")
@is_member.setter
def is_member(self, val):
val = self._is_member_validator.validate(val)
self._is_member_value = val
self._is_member_present = True
@is_member.deleter
def is_member(self):
self._is_member_value = None
self._is_member_present = False
@property
def is_owner(self):
"""
If the current user is an owner of the group.
:rtype: bool
"""
if self._is_owner_present:
return self._is_owner_value
else:
raise AttributeError("missing required field 'is_owner'")
@is_owner.setter
def is_owner(self, val):
val = self._is_owner_validator.validate(val)
self._is_owner_value = val
self._is_owner_present = True
@is_owner.deleter
def is_owner(self):
self._is_owner_value = None
self._is_owner_present = False
@property
def same_team(self):
"""
If the group is owned by the current user's team.
:rtype: bool
"""
if self._same_team_present:
return self._same_team_value
else:
raise AttributeError("missing required field 'same_team'")
@same_team.setter
def same_team(self, val):
val = self._same_team_validator.validate(val)
self._same_team_value = val
self._same_team_present = True
@same_team.deleter
def same_team(self):
self._same_team_value = None
self._same_team_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GroupInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GroupInfo(group_name={!r}, group_id={!r}, group_management_type={!r}, group_type={!r}, is_member={!r}, is_owner={!r}, same_team={!r}, group_external_id={!r}, member_count={!r})'.format(
self._group_name_value,
self._group_id_value,
self._group_management_type_value,
self._group_type_value,
self._is_member_value,
self._is_owner_value,
self._same_team_value,
self._group_external_id_value,
self._member_count_value,
)
GroupInfo_validator = bv.Struct(GroupInfo)
2019-08-28 21:48:24 +02:00
class MembershipInfo(bb.Struct):
"""
The information about a member of the shared content.
2019-08-28 21:48:24 +02:00
:ivar sharing.MembershipInfo.access_type: The access type for this member.
It contains inherited access type from parent folder, and acquired
access type from this folder.
:ivar sharing.MembershipInfo.permissions: The permissions that requesting
user has on this member. The set of permissions corresponds to the
MemberActions in the request.
:ivar sharing.MembershipInfo.initials: Never set.
:ivar sharing.MembershipInfo.is_inherited: True if the member has access
from a parent folder.
"""
__slots__ = [
'_access_type_value',
'_access_type_present',
'_permissions_value',
'_permissions_present',
'_initials_value',
'_initials_present',
'_is_inherited_value',
'_is_inherited_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
permissions=None,
initials=None,
is_inherited=None):
self._access_type_value = None
self._access_type_present = False
self._permissions_value = None
self._permissions_present = False
self._initials_value = None
self._initials_present = False
self._is_inherited_value = None
self._is_inherited_present = False
if access_type is not None:
self.access_type = access_type
if permissions is not None:
self.permissions = permissions
if initials is not None:
self.initials = initials
if is_inherited is not None:
self.is_inherited = is_inherited
@property
def access_type(self):
"""
2019-08-28 21:48:24 +02:00
The access type for this member. It contains inherited access type from
parent folder, and acquired access type from this folder.
:rtype: AccessLevel
"""
if self._access_type_present:
return self._access_type_value
else:
raise AttributeError("missing required field 'access_type'")
@access_type.setter
def access_type(self, val):
self._access_type_validator.validate_type_only(val)
self._access_type_value = val
self._access_type_present = True
@access_type.deleter
def access_type(self):
self._access_type_value = None
self._access_type_present = False
@property
def permissions(self):
"""
The permissions that requesting user has on this member. The set of
permissions corresponds to the MemberActions in the request.
:rtype: list of [MemberPermission]
"""
if self._permissions_present:
return self._permissions_value
else:
return None
@permissions.setter
def permissions(self, val):
if val is None:
del self.permissions
return
val = self._permissions_validator.validate(val)
self._permissions_value = val
self._permissions_present = True
@permissions.deleter
def permissions(self):
self._permissions_value = None
self._permissions_present = False
@property
def initials(self):
"""
2019-08-28 21:48:24 +02:00
Never set.
:rtype: str
"""
if self._initials_present:
return self._initials_value
else:
return None
@initials.setter
def initials(self, val):
if val is None:
del self.initials
return
val = self._initials_validator.validate(val)
self._initials_value = val
self._initials_present = True
@initials.deleter
def initials(self):
self._initials_value = None
self._initials_present = False
@property
def is_inherited(self):
"""
True if the member has access from a parent folder.
:rtype: bool
"""
if self._is_inherited_present:
return self._is_inherited_value
else:
return False
@is_inherited.setter
def is_inherited(self, val):
val = self._is_inherited_validator.validate(val)
self._is_inherited_value = val
self._is_inherited_present = True
@is_inherited.deleter
def is_inherited(self):
self._is_inherited_value = None
self._is_inherited_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MembershipInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MembershipInfo(access_type={!r}, permissions={!r}, initials={!r}, is_inherited={!r})'.format(
self._access_type_value,
self._permissions_value,
self._initials_value,
self._is_inherited_value,
)
MembershipInfo_validator = bv.Struct(MembershipInfo)
class GroupMembershipInfo(MembershipInfo):
"""
The information about a group member of the shared content.
2019-08-28 21:48:24 +02:00
:ivar sharing.GroupMembershipInfo.group: The information about the
membership group.
"""
__slots__ = [
'_group_value',
'_group_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
group=None,
permissions=None,
initials=None,
is_inherited=None):
super(GroupMembershipInfo, self).__init__(access_type,
permissions,
initials,
is_inherited)
self._group_value = None
self._group_present = False
if group is not None:
self.group = group
@property
def group(self):
"""
The information about the membership group.
:rtype: GroupInfo
"""
if self._group_present:
return self._group_value
else:
raise AttributeError("missing required field 'group'")
@group.setter
def group(self, val):
self._group_validator.validate_type_only(val)
self._group_value = val
self._group_present = True
@group.deleter
def group(self):
self._group_value = None
self._group_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(GroupMembershipInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'GroupMembershipInfo(access_type={!r}, group={!r}, permissions={!r}, initials={!r}, is_inherited={!r})'.format(
self._access_type_value,
self._group_value,
self._permissions_value,
self._initials_value,
self._is_inherited_value,
)
GroupMembershipInfo_validator = bv.Struct(GroupMembershipInfo)
2019-08-28 21:48:24 +02:00
class InsufficientPlan(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.InsufficientPlan.message: A message to tell the user to
upgrade in order to support expected action.
:ivar sharing.InsufficientPlan.upsell_url: A URL to send the user to in
order to obtain the account type they need, e.g. upgrading. Absent if
there is no action the user can take to upgrade.
"""
__slots__ = [
'_message_value',
'_message_present',
'_upsell_url_value',
'_upsell_url_present',
]
_has_required_fields = True
def __init__(self,
message=None,
upsell_url=None):
self._message_value = None
self._message_present = False
self._upsell_url_value = None
self._upsell_url_present = False
if message is not None:
self.message = message
if upsell_url is not None:
self.upsell_url = upsell_url
@property
def message(self):
"""
A message to tell the user to upgrade in order to support expected
action.
:rtype: str
"""
if self._message_present:
return self._message_value
else:
raise AttributeError("missing required field 'message'")
@message.setter
def message(self, val):
val = self._message_validator.validate(val)
self._message_value = val
self._message_present = True
@message.deleter
def message(self):
self._message_value = None
self._message_present = False
@property
def upsell_url(self):
"""
A URL to send the user to in order to obtain the account type they need,
e.g. upgrading. Absent if there is no action the user can take to
upgrade.
:rtype: str
"""
if self._upsell_url_present:
return self._upsell_url_value
else:
return None
@upsell_url.setter
def upsell_url(self, val):
if val is None:
del self.upsell_url
return
val = self._upsell_url_validator.validate(val)
self._upsell_url_value = val
self._upsell_url_present = True
@upsell_url.deleter
def upsell_url(self):
self._upsell_url_value = None
self._upsell_url_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(InsufficientPlan, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'InsufficientPlan(message={!r}, upsell_url={!r})'.format(
self._message_value,
self._upsell_url_value,
)
InsufficientPlan_validator = bv.Struct(InsufficientPlan)
2019-08-28 21:48:24 +02:00
class InsufficientQuotaAmounts(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.InsufficientQuotaAmounts.space_needed: The amount of space
needed to add the item (the size of the item).
:ivar sharing.InsufficientQuotaAmounts.space_shortage: The amount of extra
space needed to add the item.
:ivar sharing.InsufficientQuotaAmounts.space_left: The amount of space left
in the user's Dropbox, less than space_needed.
"""
__slots__ = [
'_space_needed_value',
'_space_needed_present',
'_space_shortage_value',
'_space_shortage_present',
'_space_left_value',
'_space_left_present',
]
_has_required_fields = True
def __init__(self,
space_needed=None,
space_shortage=None,
space_left=None):
self._space_needed_value = None
self._space_needed_present = False
self._space_shortage_value = None
self._space_shortage_present = False
self._space_left_value = None
self._space_left_present = False
if space_needed is not None:
self.space_needed = space_needed
if space_shortage is not None:
self.space_shortage = space_shortage
if space_left is not None:
self.space_left = space_left
@property
def space_needed(self):
"""
The amount of space needed to add the item (the size of the item).
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._space_needed_present:
return self._space_needed_value
else:
raise AttributeError("missing required field 'space_needed'")
@space_needed.setter
def space_needed(self, val):
val = self._space_needed_validator.validate(val)
self._space_needed_value = val
self._space_needed_present = True
@space_needed.deleter
def space_needed(self):
self._space_needed_value = None
self._space_needed_present = False
@property
def space_shortage(self):
"""
The amount of extra space needed to add the item.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._space_shortage_present:
return self._space_shortage_value
else:
raise AttributeError("missing required field 'space_shortage'")
@space_shortage.setter
def space_shortage(self, val):
val = self._space_shortage_validator.validate(val)
self._space_shortage_value = val
self._space_shortage_present = True
@space_shortage.deleter
def space_shortage(self):
self._space_shortage_value = None
self._space_shortage_present = False
@property
def space_left(self):
"""
The amount of space left in the user's Dropbox, less than space_needed.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._space_left_present:
return self._space_left_value
else:
raise AttributeError("missing required field 'space_left'")
@space_left.setter
def space_left(self, val):
val = self._space_left_validator.validate(val)
self._space_left_value = val
self._space_left_present = True
@space_left.deleter
def space_left(self):
self._space_left_value = None
self._space_left_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(InsufficientQuotaAmounts, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'InsufficientQuotaAmounts(space_needed={!r}, space_shortage={!r}, space_left={!r})'.format(
self._space_needed_value,
self._space_shortage_value,
self._space_left_value,
)
InsufficientQuotaAmounts_validator = bv.Struct(InsufficientQuotaAmounts)
class InviteeInfo(bb.Union):
"""
Information about the recipient of a shared content invitation.
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.
2019-08-28 21:48:24 +02:00
:ivar str sharing.InviteeInfo.email: E-mail address of invited user.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def email(cls, val):
"""
Create an instance of this class set to the ``email`` tag with value
``val``.
:param str val:
:rtype: InviteeInfo
"""
return cls('email', val)
def is_email(self):
"""
Check if the union tag is ``email``.
:rtype: bool
"""
return self._tag == 'email'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_email(self):
"""
E-mail address of invited user.
Only call this if :meth:`is_email` is true.
:rtype: str
"""
if not self.is_email():
raise AttributeError("tag 'email' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(InviteeInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'InviteeInfo(%r, %r)' % (self._tag, self._value)
InviteeInfo_validator = bv.Union(InviteeInfo)
class InviteeMembershipInfo(MembershipInfo):
"""
Information about an invited member of a shared content.
2019-08-28 21:48:24 +02:00
:ivar sharing.InviteeMembershipInfo.invitee: Recipient of the invitation.
:ivar sharing.InviteeMembershipInfo.user: The user this invitation is tied
to, if available.
"""
__slots__ = [
'_invitee_value',
'_invitee_present',
'_user_value',
'_user_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
invitee=None,
permissions=None,
initials=None,
is_inherited=None,
user=None):
super(InviteeMembershipInfo, self).__init__(access_type,
permissions,
initials,
is_inherited)
self._invitee_value = None
self._invitee_present = False
self._user_value = None
self._user_present = False
if invitee is not None:
self.invitee = invitee
if user is not None:
self.user = user
@property
def invitee(self):
"""
Recipient of the invitation.
:rtype: InviteeInfo
"""
if self._invitee_present:
return self._invitee_value
else:
raise AttributeError("missing required field 'invitee'")
@invitee.setter
def invitee(self, val):
self._invitee_validator.validate_type_only(val)
self._invitee_value = val
self._invitee_present = True
@invitee.deleter
def invitee(self):
self._invitee_value = None
self._invitee_present = False
@property
def user(self):
"""
The user this invitation is tied to, if available.
:rtype: UserInfo
"""
if self._user_present:
return self._user_value
else:
return None
@user.setter
def user(self, val):
if val is None:
del self.user
return
self._user_validator.validate_type_only(val)
self._user_value = val
self._user_present = True
@user.deleter
def user(self):
self._user_value = None
self._user_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(InviteeMembershipInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'InviteeMembershipInfo(access_type={!r}, invitee={!r}, permissions={!r}, initials={!r}, is_inherited={!r}, user={!r})'.format(
self._access_type_value,
self._invitee_value,
self._permissions_value,
self._initials_value,
self._is_inherited_value,
self._user_value,
)
InviteeMembershipInfo_validator = bv.Struct(InviteeMembershipInfo)
class JobError(bb.Union):
"""
Error occurred while performing an asynchronous job from
:meth:`dropbox.dropbox.Dropbox.sharing_unshare_folder` or
:meth:`dropbox.dropbox.Dropbox.sharing_remove_folder_member`.
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.
2019-08-28 21:48:24 +02:00
:ivar UnshareFolderError JobError.unshare_folder_error: Error occurred while
performing :meth:`dropbox.dropbox.Dropbox.sharing_unshare_folder`
action.
2019-08-28 21:48:24 +02:00
:ivar RemoveFolderMemberError JobError.remove_folder_member_error: Error
occurred while performing
:meth:`dropbox.dropbox.Dropbox.sharing_remove_folder_member` action.
2019-08-28 21:48:24 +02:00
:ivar RelinquishFolderMembershipError
JobError.relinquish_folder_membership_error: Error occurred while
performing
:meth:`dropbox.dropbox.Dropbox.sharing_relinquish_folder_membership`
action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def unshare_folder_error(cls, val):
"""
Create an instance of this class set to the ``unshare_folder_error`` tag
with value ``val``.
:param UnshareFolderError val:
:rtype: JobError
"""
return cls('unshare_folder_error', val)
@classmethod
def remove_folder_member_error(cls, val):
"""
Create an instance of this class set to the
``remove_folder_member_error`` tag with value ``val``.
:param RemoveFolderMemberError val:
:rtype: JobError
"""
return cls('remove_folder_member_error', val)
@classmethod
def relinquish_folder_membership_error(cls, val):
"""
Create an instance of this class set to the
``relinquish_folder_membership_error`` tag with value ``val``.
:param RelinquishFolderMembershipError val:
:rtype: JobError
"""
return cls('relinquish_folder_membership_error', val)
def is_unshare_folder_error(self):
"""
Check if the union tag is ``unshare_folder_error``.
:rtype: bool
"""
return self._tag == 'unshare_folder_error'
def is_remove_folder_member_error(self):
"""
Check if the union tag is ``remove_folder_member_error``.
:rtype: bool
"""
return self._tag == 'remove_folder_member_error'
def is_relinquish_folder_membership_error(self):
"""
Check if the union tag is ``relinquish_folder_membership_error``.
:rtype: bool
"""
return self._tag == 'relinquish_folder_membership_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_unshare_folder_error(self):
"""
Error occurred while performing
:meth:`dropbox.dropbox.Dropbox.sharing_unshare_folder` action.
Only call this if :meth:`is_unshare_folder_error` is true.
:rtype: UnshareFolderError
"""
if not self.is_unshare_folder_error():
raise AttributeError("tag 'unshare_folder_error' not set")
return self._value
def get_remove_folder_member_error(self):
"""
Error occurred while performing
:meth:`dropbox.dropbox.Dropbox.sharing_remove_folder_member` action.
Only call this if :meth:`is_remove_folder_member_error` is true.
:rtype: RemoveFolderMemberError
"""
if not self.is_remove_folder_member_error():
raise AttributeError("tag 'remove_folder_member_error' not set")
return self._value
def get_relinquish_folder_membership_error(self):
"""
Error occurred while performing
:meth:`dropbox.dropbox.Dropbox.sharing_relinquish_folder_membership`
action.
Only call this if :meth:`is_relinquish_folder_membership_error` is true.
:rtype: RelinquishFolderMembershipError
"""
if not self.is_relinquish_folder_membership_error():
raise AttributeError("tag 'relinquish_folder_membership_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(JobError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'JobError(%r, %r)' % (self._tag, self._value)
JobError_validator = bv.Union(JobError)
2019-08-28 21:48:24 +02:00
class JobStatus(async_.PollResultBase):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.JobStatus.complete: The asynchronous job has finished.
:ivar JobError JobStatus.failed: The asynchronous job returned an error.
"""
# Attribute is overwritten below the class definition
complete = None
@classmethod
def failed(cls, val):
"""
Create an instance of this class set to the ``failed`` tag with value
``val``.
:param JobError val:
:rtype: JobStatus
"""
return cls('failed', val)
def is_complete(self):
"""
Check if the union tag is ``complete``.
:rtype: bool
"""
return self._tag == 'complete'
def is_failed(self):
"""
Check if the union tag is ``failed``.
:rtype: bool
"""
return self._tag == 'failed'
def get_failed(self):
"""
The asynchronous job returned an error.
Only call this if :meth:`is_failed` is true.
:rtype: JobError
"""
if not self.is_failed():
raise AttributeError("tag 'failed' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(JobStatus, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'JobStatus(%r, %r)' % (self._tag, self._value)
JobStatus_validator = bv.Union(JobStatus)
2019-08-28 21:48:24 +02:00
class LinkAccessLevel(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 sharing.LinkAccessLevel.viewer: Users who use the link can view and
comment on the content.
:ivar sharing.LinkAccessLevel.editor: Users who use the link can edit, view
and comment on the content.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
viewer = None
# Attribute is overwritten below the class definition
editor = None
# Attribute is overwritten below the class definition
other = None
def is_viewer(self):
"""
Check if the union tag is ``viewer``.
:rtype: bool
"""
return self._tag == 'viewer'
def is_editor(self):
"""
Check if the union tag is ``editor``.
:rtype: bool
"""
return self._tag == 'editor'
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(LinkAccessLevel, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkAccessLevel(%r, %r)' % (self._tag, self._value)
LinkAccessLevel_validator = bv.Union(LinkAccessLevel)
class LinkAction(bb.Union):
"""
Actions that can be performed on a link.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.LinkAction.change_access_level: Change the access level of the
link.
:ivar sharing.LinkAction.change_audience: Change the audience of the link.
:ivar sharing.LinkAction.remove_expiry: Remove the expiry date of the link.
:ivar sharing.LinkAction.remove_password: Remove the password of the link.
:ivar sharing.LinkAction.set_expiry: Create or modify the expiry date of the
link.
:ivar sharing.LinkAction.set_password: Create or modify the password of the
link.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
change_access_level = None
# Attribute is overwritten below the class definition
change_audience = None
# Attribute is overwritten below the class definition
remove_expiry = None
# Attribute is overwritten below the class definition
remove_password = None
# Attribute is overwritten below the class definition
set_expiry = None
# Attribute is overwritten below the class definition
set_password = None
# Attribute is overwritten below the class definition
other = None
def is_change_access_level(self):
"""
Check if the union tag is ``change_access_level``.
:rtype: bool
"""
return self._tag == 'change_access_level'
def is_change_audience(self):
"""
Check if the union tag is ``change_audience``.
:rtype: bool
"""
return self._tag == 'change_audience'
def is_remove_expiry(self):
"""
Check if the union tag is ``remove_expiry``.
:rtype: bool
"""
return self._tag == 'remove_expiry'
def is_remove_password(self):
"""
Check if the union tag is ``remove_password``.
:rtype: bool
"""
return self._tag == 'remove_password'
def is_set_expiry(self):
"""
Check if the union tag is ``set_expiry``.
:rtype: bool
"""
return self._tag == 'set_expiry'
def is_set_password(self):
"""
Check if the union tag is ``set_password``.
:rtype: bool
"""
return self._tag == 'set_password'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkAction, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkAction(%r, %r)' % (self._tag, self._value)
LinkAction_validator = bv.Union(LinkAction)
class LinkAudience(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.LinkAudience.public: Link is accessible by anyone.
:ivar sharing.LinkAudience.team: Link is accessible only by team members.
:ivar sharing.LinkAudience.no_one: The link can be used by no one. The link
merely points the user to the content, and does not grant additional
rights to the user. Members of the content who use this link can only
access the content with their pre-existing access rights.
:ivar sharing.LinkAudience.password: A link-specific password is required to
access the link. Login is not required.
:ivar sharing.LinkAudience.members: Link is accessible only by members of
the content.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
public = None
# Attribute is overwritten below the class definition
team = None
# Attribute is overwritten below the class definition
2019-08-28 21:48:24 +02:00
no_one = None
# Attribute is overwritten below the class definition
password = None
# Attribute is overwritten below the class definition
members = None
# Attribute is overwritten below the class definition
other = None
def is_public(self):
"""
Check if the union tag is ``public``.
:rtype: bool
"""
return self._tag == 'public'
def is_team(self):
"""
Check if the union tag is ``team``.
:rtype: bool
"""
return self._tag == 'team'
2019-08-28 21:48:24 +02:00
def is_no_one(self):
"""
Check if the union tag is ``no_one``.
:rtype: bool
"""
return self._tag == 'no_one'
def is_password(self):
"""
Check if the union tag is ``password``.
:rtype: bool
"""
return self._tag == 'password'
def is_members(self):
"""
Check if the union tag is ``members``.
:rtype: bool
"""
return self._tag == 'members'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkAudience, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkAudience(%r, %r)' % (self._tag, self._value)
LinkAudience_validator = bv.Union(LinkAudience)
class LinkExpiry(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.LinkExpiry.remove_expiry: Remove the currently set expiry for
the link.
:ivar datetime.datetime sharing.LinkExpiry.set_expiry: Set a new expiry or
change an existing expiry.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
remove_expiry = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def set_expiry(cls, val):
"""
Create an instance of this class set to the ``set_expiry`` tag with
value ``val``.
:param datetime.datetime val:
:rtype: LinkExpiry
"""
return cls('set_expiry', val)
def is_remove_expiry(self):
"""
Check if the union tag is ``remove_expiry``.
:rtype: bool
"""
return self._tag == 'remove_expiry'
def is_set_expiry(self):
"""
Check if the union tag is ``set_expiry``.
:rtype: bool
"""
return self._tag == 'set_expiry'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_set_expiry(self):
"""
Set a new expiry or change an existing expiry.
Only call this if :meth:`is_set_expiry` is true.
:rtype: datetime.datetime
"""
if not self.is_set_expiry():
raise AttributeError("tag 'set_expiry' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkExpiry, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkExpiry(%r, %r)' % (self._tag, self._value)
LinkExpiry_validator = bv.Union(LinkExpiry)
class LinkPassword(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.LinkPassword.remove_password: Remove the currently set
password for the link.
:ivar str sharing.LinkPassword.set_password: Set a new password or change an
existing password.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
remove_password = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def set_password(cls, val):
"""
Create an instance of this class set to the ``set_password`` tag with
value ``val``.
:param str val:
:rtype: LinkPassword
"""
return cls('set_password', val)
def is_remove_password(self):
"""
Check if the union tag is ``remove_password``.
:rtype: bool
"""
return self._tag == 'remove_password'
def is_set_password(self):
"""
Check if the union tag is ``set_password``.
:rtype: bool
"""
return self._tag == 'set_password'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_set_password(self):
"""
Set a new password or change an existing password.
Only call this if :meth:`is_set_password` is true.
:rtype: str
"""
if not self.is_set_password():
raise AttributeError("tag 'set_password' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkPassword, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkPassword(%r, %r)' % (self._tag, self._value)
LinkPassword_validator = bv.Union(LinkPassword)
2019-08-28 21:48:24 +02:00
class LinkPermission(bb.Struct):
"""
Permissions for actions that can be performed on a link.
"""
__slots__ = [
'_action_value',
'_action_present',
'_allow_value',
'_allow_present',
'_reason_value',
'_reason_present',
]
_has_required_fields = True
def __init__(self,
action=None,
allow=None,
reason=None):
self._action_value = None
self._action_present = False
self._allow_value = None
self._allow_present = False
self._reason_value = None
self._reason_present = False
if action is not None:
self.action = action
if allow is not None:
self.allow = allow
if reason is not None:
self.reason = reason
@property
def action(self):
"""
:rtype: LinkAction
"""
if self._action_present:
return self._action_value
else:
raise AttributeError("missing required field 'action'")
@action.setter
def action(self, val):
self._action_validator.validate_type_only(val)
self._action_value = val
self._action_present = True
@action.deleter
def action(self):
self._action_value = None
self._action_present = False
@property
def allow(self):
"""
:rtype: bool
"""
if self._allow_present:
return self._allow_value
else:
raise AttributeError("missing required field 'allow'")
@allow.setter
def allow(self, val):
val = self._allow_validator.validate(val)
self._allow_value = val
self._allow_present = True
@allow.deleter
def allow(self):
self._allow_value = None
self._allow_present = False
@property
def reason(self):
"""
:rtype: PermissionDeniedReason
"""
if self._reason_present:
return self._reason_value
else:
return None
@reason.setter
def reason(self, val):
if val is None:
del self.reason
return
self._reason_validator.validate_type_only(val)
self._reason_value = val
self._reason_present = True
@reason.deleter
def reason(self):
self._reason_value = None
self._reason_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkPermission, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkPermission(action={!r}, allow={!r}, reason={!r})'.format(
self._action_value,
self._allow_value,
self._reason_value,
)
LinkPermission_validator = bv.Struct(LinkPermission)
2019-08-28 21:48:24 +02:00
class LinkPermissions(bb.Struct):
"""
:ivar sharing.LinkPermissions.resolved_visibility: The current visibility of
the link after considering the shared links policies of the the team (in
case the link's owner is part of a team) and the shared folder (in case
the linked file is part of a shared folder). This field is shown only if
the caller has access to this info (the link's owner always has access
to this data). For some links, an effective_audience value is returned
instead.
:ivar sharing.LinkPermissions.requested_visibility: The shared link's
requested visibility. This can be overridden by the team and shared
folder policies. The final visibility, after considering these policies,
can be found in ``resolved_visibility``. This is shown only if the
caller is the link's owner and resolved_visibility is returned instead
of effective_audience.
:ivar sharing.LinkPermissions.can_revoke: Whether the caller can revoke the
shared link.
:ivar sharing.LinkPermissions.revoke_failure_reason: The failure reason for
revoking the link. This field will only be present if the ``can_revoke``
is ``False``.
:ivar sharing.LinkPermissions.effective_audience: The type of audience who
can benefit from the access level specified by the `link_access_level`
field.
:ivar sharing.LinkPermissions.link_access_level: The access level that the
link will grant to its users. A link can grant additional rights to a
user beyond their current access level. For example, if a user was
invited as a viewer to a file, and then opens a link with
`link_access_level` set to `editor`, then they will gain editor
privileges. The `link_access_level` is a property of the link, and does
not depend on who is calling this API. In particular,
`link_access_level` does not take into account the API caller's current
permissions to the content.
"""
__slots__ = [
'_resolved_visibility_value',
'_resolved_visibility_present',
'_requested_visibility_value',
'_requested_visibility_present',
'_can_revoke_value',
'_can_revoke_present',
'_revoke_failure_reason_value',
'_revoke_failure_reason_present',
2019-08-28 21:48:24 +02:00
'_effective_audience_value',
'_effective_audience_present',
'_link_access_level_value',
'_link_access_level_present',
]
_has_required_fields = True
def __init__(self,
can_revoke=None,
resolved_visibility=None,
requested_visibility=None,
2019-08-28 21:48:24 +02:00
revoke_failure_reason=None,
effective_audience=None,
link_access_level=None):
self._resolved_visibility_value = None
self._resolved_visibility_present = False
self._requested_visibility_value = None
self._requested_visibility_present = False
self._can_revoke_value = None
self._can_revoke_present = False
self._revoke_failure_reason_value = None
self._revoke_failure_reason_present = False
2019-08-28 21:48:24 +02:00
self._effective_audience_value = None
self._effective_audience_present = False
self._link_access_level_value = None
self._link_access_level_present = False
if resolved_visibility is not None:
self.resolved_visibility = resolved_visibility
if requested_visibility is not None:
self.requested_visibility = requested_visibility
if can_revoke is not None:
self.can_revoke = can_revoke
if revoke_failure_reason is not None:
self.revoke_failure_reason = revoke_failure_reason
2019-08-28 21:48:24 +02:00
if effective_audience is not None:
self.effective_audience = effective_audience
if link_access_level is not None:
self.link_access_level = link_access_level
@property
def resolved_visibility(self):
"""
The current visibility of the link after considering the shared links
policies of the the team (in case the link's owner is part of a team)
and the shared folder (in case the linked file is part of a shared
folder). This field is shown only if the caller has access to this info
2019-08-28 21:48:24 +02:00
(the link's owner always has access to this data). For some links, an
effective_audience value is returned instead.
:rtype: ResolvedVisibility
"""
if self._resolved_visibility_present:
return self._resolved_visibility_value
else:
return None
@resolved_visibility.setter
def resolved_visibility(self, val):
if val is None:
del self.resolved_visibility
return
self._resolved_visibility_validator.validate_type_only(val)
self._resolved_visibility_value = val
self._resolved_visibility_present = True
@resolved_visibility.deleter
def resolved_visibility(self):
self._resolved_visibility_value = None
self._resolved_visibility_present = False
@property
def requested_visibility(self):
"""
The shared link's requested visibility. This can be overridden by the
team and shared folder policies. The final visibility, after considering
these policies, can be found in ``resolved_visibility``. This is shown
2019-08-28 21:48:24 +02:00
only if the caller is the link's owner and resolved_visibility is
returned instead of effective_audience.
:rtype: RequestedVisibility
"""
if self._requested_visibility_present:
return self._requested_visibility_value
else:
return None
@requested_visibility.setter
def requested_visibility(self, val):
if val is None:
del self.requested_visibility
return
self._requested_visibility_validator.validate_type_only(val)
self._requested_visibility_value = val
self._requested_visibility_present = True
@requested_visibility.deleter
def requested_visibility(self):
self._requested_visibility_value = None
self._requested_visibility_present = False
@property
def can_revoke(self):
"""
Whether the caller can revoke the shared link.
:rtype: bool
"""
if self._can_revoke_present:
return self._can_revoke_value
else:
raise AttributeError("missing required field 'can_revoke'")
@can_revoke.setter
def can_revoke(self, val):
val = self._can_revoke_validator.validate(val)
self._can_revoke_value = val
self._can_revoke_present = True
@can_revoke.deleter
def can_revoke(self):
self._can_revoke_value = None
self._can_revoke_present = False
@property
def revoke_failure_reason(self):
"""
The failure reason for revoking the link. This field will only be
present if the ``can_revoke`` is ``False``.
:rtype: SharedLinkAccessFailureReason
"""
if self._revoke_failure_reason_present:
return self._revoke_failure_reason_value
else:
return None
@revoke_failure_reason.setter
def revoke_failure_reason(self, val):
if val is None:
del self.revoke_failure_reason
return
self._revoke_failure_reason_validator.validate_type_only(val)
self._revoke_failure_reason_value = val
self._revoke_failure_reason_present = True
@revoke_failure_reason.deleter
def revoke_failure_reason(self):
self._revoke_failure_reason_value = None
self._revoke_failure_reason_present = False
2019-08-28 21:48:24 +02:00
@property
def effective_audience(self):
"""
The type of audience who can benefit from the access level specified by
the `link_access_level` field.
2019-08-28 21:48:24 +02:00
:rtype: LinkAudience
"""
if self._effective_audience_present:
return self._effective_audience_value
else:
return None
@effective_audience.setter
def effective_audience(self, val):
if val is None:
del self.effective_audience
return
self._effective_audience_validator.validate_type_only(val)
self._effective_audience_value = val
self._effective_audience_present = True
@effective_audience.deleter
def effective_audience(self):
self._effective_audience_value = None
self._effective_audience_present = False
@property
def link_access_level(self):
"""
The access level that the link will grant to its users. A link can grant
additional rights to a user beyond their current access level. For
example, if a user was invited as a viewer to a file, and then opens a
link with `link_access_level` set to `editor`, then they will gain
editor privileges. The `link_access_level` is a property of the link,
and does not depend on who is calling this API. In particular,
`link_access_level` does not take into account the API caller's current
permissions to the content.
:rtype: LinkAccessLevel
"""
if self._link_access_level_present:
return self._link_access_level_value
else:
return None
@link_access_level.setter
def link_access_level(self, val):
if val is None:
del self.link_access_level
return
self._link_access_level_validator.validate_type_only(val)
self._link_access_level_value = val
self._link_access_level_present = True
@link_access_level.deleter
def link_access_level(self):
self._link_access_level_value = None
self._link_access_level_present = False
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkPermissions, self)._process_custom_annotations(annotation_type, field_path, processor)
2019-08-28 21:48:24 +02:00
def __repr__(self):
return 'LinkPermissions(can_revoke={!r}, resolved_visibility={!r}, requested_visibility={!r}, revoke_failure_reason={!r}, effective_audience={!r}, link_access_level={!r})'.format(
self._can_revoke_value,
self._resolved_visibility_value,
self._requested_visibility_value,
self._revoke_failure_reason_value,
self._effective_audience_value,
self._link_access_level_value,
)
LinkPermissions_validator = bv.Struct(LinkPermissions)
class LinkSettings(bb.Struct):
"""
Settings that apply to a link.
2019-08-28 21:48:24 +02:00
:ivar sharing.LinkSettings.access_level: The access level on the link for
this file. Currently, it only accepts 'viewer' and 'viewer_no_comment'.
:ivar sharing.LinkSettings.audience: The type of audience on the link for
this file.
:ivar sharing.LinkSettings.expiry: An expiry timestamp to set on a link.
:ivar sharing.LinkSettings.password: The password for the link.
"""
__slots__ = [
'_access_level_value',
'_access_level_present',
'_audience_value',
'_audience_present',
'_expiry_value',
'_expiry_present',
'_password_value',
'_password_present',
]
_has_required_fields = False
def __init__(self,
access_level=None,
audience=None,
expiry=None,
password=None):
self._access_level_value = None
self._access_level_present = False
self._audience_value = None
self._audience_present = False
self._expiry_value = None
self._expiry_present = False
self._password_value = None
self._password_present = False
if access_level is not None:
self.access_level = access_level
if audience is not None:
self.audience = audience
if expiry is not None:
self.expiry = expiry
if password is not None:
self.password = password
@property
def access_level(self):
"""
The access level on the link for this file. Currently, it only accepts
'viewer' and 'viewer_no_comment'.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
return None
@access_level.setter
def access_level(self, val):
if val is None:
del self.access_level
return
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
@property
def audience(self):
"""
The type of audience on the link for this file.
:rtype: LinkAudience
"""
if self._audience_present:
return self._audience_value
else:
return None
@audience.setter
def audience(self, val):
if val is None:
del self.audience
return
self._audience_validator.validate_type_only(val)
self._audience_value = val
self._audience_present = True
@audience.deleter
def audience(self):
self._audience_value = None
self._audience_present = False
@property
def expiry(self):
"""
An expiry timestamp to set on a link.
:rtype: LinkExpiry
"""
if self._expiry_present:
return self._expiry_value
else:
return None
@expiry.setter
def expiry(self, val):
if val is None:
del self.expiry
return
self._expiry_validator.validate_type_only(val)
self._expiry_value = val
self._expiry_present = True
@expiry.deleter
def expiry(self):
self._expiry_value = None
self._expiry_present = False
@property
def password(self):
"""
The password for the link.
:rtype: LinkPassword
"""
if self._password_present:
return self._password_value
else:
return None
@password.setter
def password(self, val):
if val is None:
del self.password
return
self._password_validator.validate_type_only(val)
self._password_value = val
self._password_present = True
@password.deleter
def password(self):
self._password_value = None
self._password_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(LinkSettings, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'LinkSettings(access_level={!r}, audience={!r}, expiry={!r}, password={!r})'.format(
self._access_level_value,
self._audience_value,
self._expiry_value,
self._password_value,
)
LinkSettings_validator = bv.Struct(LinkSettings)
2019-08-28 21:48:24 +02:00
class ListFileMembersArg(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.sharing_list_file_members`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFileMembersArg.file: The file for which you want to see
members.
:ivar sharing.ListFileMembersArg.actions: The actions for which to return
permissions on a member.
:ivar sharing.ListFileMembersArg.include_inherited: Whether to include
members who only have access from a parent shared folder.
:ivar sharing.ListFileMembersArg.limit: Number of members to return max per
query. Defaults to 100 if no limit is specified.
"""
__slots__ = [
'_file_value',
'_file_present',
'_actions_value',
'_actions_present',
'_include_inherited_value',
'_include_inherited_present',
'_limit_value',
'_limit_present',
]
_has_required_fields = True
def __init__(self,
file=None,
actions=None,
include_inherited=None,
limit=None):
self._file_value = None
self._file_present = False
self._actions_value = None
self._actions_present = False
self._include_inherited_value = None
self._include_inherited_present = False
self._limit_value = None
self._limit_present = False
if file is not None:
self.file = file
if actions is not None:
self.actions = actions
if include_inherited is not None:
self.include_inherited = include_inherited
if limit is not None:
self.limit = limit
@property
def file(self):
"""
The file for which you want to see members.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def actions(self):
"""
The actions for which to return permissions on a member.
:rtype: list of [MemberAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
@property
def include_inherited(self):
"""
Whether to include members who only have access from a parent shared
folder.
:rtype: bool
"""
if self._include_inherited_present:
return self._include_inherited_value
else:
return True
@include_inherited.setter
def include_inherited(self, val):
val = self._include_inherited_validator.validate(val)
self._include_inherited_value = val
self._include_inherited_present = True
@include_inherited.deleter
def include_inherited(self):
self._include_inherited_value = None
self._include_inherited_present = False
@property
def limit(self):
"""
Number of members to return max per query. Defaults to 100 if no limit
is specified.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._limit_present:
return self._limit_value
else:
return 100
@limit.setter
def limit(self, val):
val = self._limit_validator.validate(val)
self._limit_value = val
self._limit_present = True
@limit.deleter
def limit(self):
self._limit_value = None
self._limit_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersArg(file={!r}, actions={!r}, include_inherited={!r}, limit={!r})'.format(
self._file_value,
self._actions_value,
self._include_inherited_value,
self._limit_value,
)
ListFileMembersArg_validator = bv.Struct(ListFileMembersArg)
2019-08-28 21:48:24 +02:00
class ListFileMembersBatchArg(bb.Struct):
"""
Arguments for
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_batch`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFileMembersBatchArg.files: Files for which to return
members.
:ivar sharing.ListFileMembersBatchArg.limit: Number of members to return max
per query. Defaults to 10 if no limit is specified.
"""
__slots__ = [
'_files_value',
'_files_present',
'_limit_value',
'_limit_present',
]
_has_required_fields = True
def __init__(self,
files=None,
limit=None):
self._files_value = None
self._files_present = False
self._limit_value = None
self._limit_present = False
if files is not None:
self.files = files
if limit is not None:
self.limit = limit
@property
def files(self):
"""
Files for which to return members.
:rtype: list of [str]
"""
if self._files_present:
return self._files_value
else:
raise AttributeError("missing required field 'files'")
@files.setter
def files(self, val):
val = self._files_validator.validate(val)
self._files_value = val
self._files_present = True
@files.deleter
def files(self):
self._files_value = None
self._files_present = False
@property
def limit(self):
"""
Number of members to return max per query. Defaults to 10 if no limit is
specified.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._limit_present:
return self._limit_value
else:
return 10
@limit.setter
def limit(self, val):
val = self._limit_validator.validate(val)
self._limit_value = val
self._limit_present = True
@limit.deleter
def limit(self):
self._limit_value = None
self._limit_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersBatchArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersBatchArg(files={!r}, limit={!r})'.format(
self._files_value,
self._limit_value,
)
ListFileMembersBatchArg_validator = bv.Struct(ListFileMembersBatchArg)
2019-08-28 21:48:24 +02:00
class ListFileMembersBatchResult(bb.Struct):
"""
Per-file result for
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_batch`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFileMembersBatchResult.file: This is the input file
identifier, whether an ID or a path.
:ivar sharing.ListFileMembersBatchResult.result: The result for this
particular file.
"""
__slots__ = [
'_file_value',
'_file_present',
'_result_value',
'_result_present',
]
_has_required_fields = True
def __init__(self,
file=None,
result=None):
self._file_value = None
self._file_present = False
self._result_value = None
self._result_present = False
if file is not None:
self.file = file
if result is not None:
self.result = result
@property
def file(self):
"""
This is the input file identifier, whether an ID or a path.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def result(self):
"""
The result for this particular file.
:rtype: ListFileMembersIndividualResult
"""
if self._result_present:
return self._result_value
else:
raise AttributeError("missing required field 'result'")
@result.setter
def result(self, val):
self._result_validator.validate_type_only(val)
self._result_value = val
self._result_present = True
@result.deleter
def result(self):
self._result_value = None
self._result_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersBatchResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersBatchResult(file={!r}, result={!r})'.format(
self._file_value,
self._result_value,
)
ListFileMembersBatchResult_validator = bv.Struct(ListFileMembersBatchResult)
2019-08-28 21:48:24 +02:00
class ListFileMembersContinueArg(bb.Struct):
"""
Arguments for
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFileMembersContinueArg.cursor: The cursor returned by your
last call to :meth:`dropbox.dropbox.Dropbox.sharing_list_file_members`,
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue`, or
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_batch`.
"""
__slots__ = [
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
cursor=None):
self._cursor_value = None
self._cursor_present = False
if cursor is not None:
self.cursor = cursor
@property
def cursor(self):
"""
The cursor returned by your last call to
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members`,
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue`, or
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_batch`.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
raise AttributeError("missing required field 'cursor'")
@cursor.setter
def cursor(self, val):
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersContinueArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersContinueArg(cursor={!r})'.format(
self._cursor_value,
)
ListFileMembersContinueArg_validator = bv.Struct(ListFileMembersContinueArg)
class ListFileMembersContinueError(bb.Union):
"""
Error for
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue`.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFileMembersContinueError.invalid_cursor:
``ListFileMembersContinueArg.cursor`` is invalid.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_cursor = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: ListFileMembersContinueError
"""
return cls('user_error', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: ListFileMembersContinueError
"""
return cls('access_error', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_invalid_cursor(self):
"""
Check if the union tag is ``invalid_cursor``.
:rtype: bool
"""
return self._tag == 'invalid_cursor'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersContinueError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersContinueError(%r, %r)' % (self._tag, self._value)
ListFileMembersContinueError_validator = bv.Union(ListFileMembersContinueError)
2019-08-28 21:48:24 +02:00
class ListFileMembersCountResult(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFileMembersCountResult.members: A list of members on this
file.
:ivar sharing.ListFileMembersCountResult.member_count: The number of members
on this file. This does not include inherited members.
"""
__slots__ = [
'_members_value',
'_members_present',
'_member_count_value',
'_member_count_present',
]
_has_required_fields = True
def __init__(self,
members=None,
member_count=None):
self._members_value = None
self._members_present = False
self._member_count_value = None
self._member_count_present = False
if members is not None:
self.members = members
if member_count is not None:
self.member_count = member_count
@property
def members(self):
"""
A list of members on this file.
:rtype: SharedFileMembers
"""
if self._members_present:
return self._members_value
else:
raise AttributeError("missing required field 'members'")
@members.setter
def members(self, val):
self._members_validator.validate_type_only(val)
self._members_value = val
self._members_present = True
@members.deleter
def members(self):
self._members_value = None
self._members_present = False
@property
def member_count(self):
"""
The number of members on this file. This does not include inherited
members.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._member_count_present:
return self._member_count_value
else:
raise AttributeError("missing required field 'member_count'")
@member_count.setter
def member_count(self, val):
val = self._member_count_validator.validate(val)
self._member_count_value = val
self._member_count_present = True
@member_count.deleter
def member_count(self):
self._member_count_value = None
self._member_count_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersCountResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersCountResult(members={!r}, member_count={!r})'.format(
self._members_value,
self._member_count_value,
)
ListFileMembersCountResult_validator = bv.Struct(ListFileMembersCountResult)
class ListFileMembersError(bb.Union):
"""
Error for :meth:`dropbox.dropbox.Dropbox.sharing_list_file_members`.
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 user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: ListFileMembersError
"""
return cls('user_error', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: ListFileMembersError
"""
return cls('access_error', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersError(%r, %r)' % (self._tag, self._value)
ListFileMembersError_validator = bv.Union(ListFileMembersError)
class ListFileMembersIndividualResult(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.
2019-08-28 21:48:24 +02:00
:ivar ListFileMembersCountResult ListFileMembersIndividualResult.result: The
results of the query for this file if it was successful.
:ivar SharingFileAccessError ListFileMembersIndividualResult.access_error:
The result of the query for this file if it was an error.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def result(cls, val):
"""
Create an instance of this class set to the ``result`` tag with value
``val``.
:param ListFileMembersCountResult val:
:rtype: ListFileMembersIndividualResult
"""
return cls('result', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: ListFileMembersIndividualResult
"""
return cls('access_error', val)
def is_result(self):
"""
Check if the union tag is ``result``.
:rtype: bool
"""
return self._tag == 'result'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_result(self):
"""
The results of the query for this file if it was successful.
Only call this if :meth:`is_result` is true.
:rtype: ListFileMembersCountResult
"""
if not self.is_result():
raise AttributeError("tag 'result' not set")
return self._value
def get_access_error(self):
"""
The result of the query for this file if it was an error.
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFileMembersIndividualResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFileMembersIndividualResult(%r, %r)' % (self._tag, self._value)
ListFileMembersIndividualResult_validator = bv.Union(ListFileMembersIndividualResult)
2019-08-28 21:48:24 +02:00
class ListFilesArg(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.sharing_list_received_files`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFilesArg.limit: Number of files to return max per query.
Defaults to 100 if no limit is specified.
:ivar sharing.ListFilesArg.actions: A list of `FileAction`s corresponding to
`FilePermission`s that should appear in the response's
``SharedFileMetadata.permissions`` field describing the actions the
authenticated user can perform on the file.
"""
__slots__ = [
'_limit_value',
'_limit_present',
'_actions_value',
'_actions_present',
]
_has_required_fields = False
def __init__(self,
limit=None,
actions=None):
self._limit_value = None
self._limit_present = False
self._actions_value = None
self._actions_present = False
if limit is not None:
self.limit = limit
if actions is not None:
self.actions = actions
@property
def limit(self):
"""
Number of files to return max per query. Defaults to 100 if no limit is
specified.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._limit_present:
return self._limit_value
else:
return 100
@limit.setter
def limit(self, val):
val = self._limit_validator.validate(val)
self._limit_value = val
self._limit_present = True
@limit.deleter
def limit(self):
self._limit_value = None
self._limit_present = False
@property
def actions(self):
"""
A list of `FileAction`s corresponding to `FilePermission`s that should
appear in the response's ``SharedFileMetadata.permissions`` field
describing the actions the authenticated user can perform on the file.
:rtype: list of [FileAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFilesArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFilesArg(limit={!r}, actions={!r})'.format(
self._limit_value,
self._actions_value,
)
ListFilesArg_validator = bv.Struct(ListFilesArg)
2019-08-28 21:48:24 +02:00
class ListFilesContinueArg(bb.Struct):
"""
Arguments for
:meth:`dropbox.dropbox.Dropbox.sharing_list_received_files_continue`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFilesContinueArg.cursor: Cursor in
``ListFilesResult.cursor``.
"""
__slots__ = [
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
cursor=None):
self._cursor_value = None
self._cursor_present = False
if cursor is not None:
self.cursor = cursor
@property
def cursor(self):
"""
Cursor in ``ListFilesResult.cursor``.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
raise AttributeError("missing required field 'cursor'")
@cursor.setter
def cursor(self, val):
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFilesContinueArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFilesContinueArg(cursor={!r})'.format(
self._cursor_value,
)
ListFilesContinueArg_validator = bv.Struct(ListFilesContinueArg)
class ListFilesContinueError(bb.Union):
"""
Error results for
:meth:`dropbox.dropbox.Dropbox.sharing_list_received_files_continue`.
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.
2019-08-28 21:48:24 +02:00
:ivar SharingUserError ListFilesContinueError.user_error: User account had a
problem.
:ivar sharing.ListFilesContinueError.invalid_cursor:
``ListFilesContinueArg.cursor`` is invalid.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_cursor = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: ListFilesContinueError
"""
return cls('user_error', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_invalid_cursor(self):
"""
Check if the union tag is ``invalid_cursor``.
:rtype: bool
"""
return self._tag == 'invalid_cursor'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
User account had a problem.
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFilesContinueError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFilesContinueError(%r, %r)' % (self._tag, self._value)
ListFilesContinueError_validator = bv.Union(ListFilesContinueError)
2019-08-28 21:48:24 +02:00
class ListFilesResult(bb.Struct):
"""
Success results for
:meth:`dropbox.dropbox.Dropbox.sharing_list_received_files`.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFilesResult.entries: Information about the files shared
with current user.
:ivar sharing.ListFilesResult.cursor: Cursor used to obtain additional
shared files.
"""
__slots__ = [
'_entries_value',
'_entries_present',
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
entries=None,
cursor=None):
self._entries_value = None
self._entries_present = False
self._cursor_value = None
self._cursor_present = False
if entries is not None:
self.entries = entries
if cursor is not None:
self.cursor = cursor
@property
def entries(self):
"""
Information about the files shared with current user.
:rtype: list of [SharedFileMetadata]
"""
if self._entries_present:
return self._entries_value
else:
raise AttributeError("missing required field 'entries'")
@entries.setter
def entries(self, val):
val = self._entries_validator.validate(val)
self._entries_value = val
self._entries_present = True
@entries.deleter
def entries(self):
self._entries_value = None
self._entries_present = False
@property
def cursor(self):
"""
Cursor used to obtain additional shared files.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
return None
@cursor.setter
def cursor(self, val):
if val is None:
del self.cursor
return
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFilesResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFilesResult(entries={!r}, cursor={!r})'.format(
self._entries_value,
self._cursor_value,
)
ListFilesResult_validator = bv.Struct(ListFilesResult)
2019-08-28 21:48:24 +02:00
class ListFolderMembersCursorArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFolderMembersCursorArg.actions: This is a list indicating
whether each returned member will include a boolean value
``MemberPermission.allow`` that describes whether the current user can
perform the MemberAction on the member.
:ivar sharing.ListFolderMembersCursorArg.limit: The maximum number of
results that include members, groups and invitees to return per request.
"""
__slots__ = [
'_actions_value',
'_actions_present',
'_limit_value',
'_limit_present',
]
_has_required_fields = False
def __init__(self,
actions=None,
limit=None):
self._actions_value = None
self._actions_present = False
self._limit_value = None
self._limit_present = False
if actions is not None:
self.actions = actions
if limit is not None:
self.limit = limit
@property
def actions(self):
"""
This is a list indicating whether each returned member will include a
boolean value ``MemberPermission.allow`` that describes whether the
current user can perform the MemberAction on the member.
:rtype: list of [MemberAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
@property
def limit(self):
"""
The maximum number of results that include members, groups and invitees
to return per request.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._limit_present:
return self._limit_value
else:
return 1000
@limit.setter
def limit(self, val):
val = self._limit_validator.validate(val)
self._limit_value = val
self._limit_present = True
@limit.deleter
def limit(self):
self._limit_value = None
self._limit_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFolderMembersCursorArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFolderMembersCursorArg(actions={!r}, limit={!r})'.format(
self._actions_value,
self._limit_value,
)
ListFolderMembersCursorArg_validator = bv.Struct(ListFolderMembersCursorArg)
class ListFolderMembersArgs(ListFolderMembersCursorArg):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFolderMembersArgs.shared_folder_id: The ID for the shared
folder.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
actions=None,
limit=None):
super(ListFolderMembersArgs, self).__init__(actions,
limit)
self._shared_folder_id_value = None
self._shared_folder_id_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFolderMembersArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFolderMembersArgs(shared_folder_id={!r}, actions={!r}, limit={!r})'.format(
self._shared_folder_id_value,
self._actions_value,
self._limit_value,
)
ListFolderMembersArgs_validator = bv.Struct(ListFolderMembersArgs)
2019-08-28 21:48:24 +02:00
class ListFolderMembersContinueArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFolderMembersContinueArg.cursor: The cursor returned by
your last call to
:meth:`dropbox.dropbox.Dropbox.sharing_list_folder_members` or
:meth:`dropbox.dropbox.Dropbox.sharing_list_folder_members_continue`.
"""
__slots__ = [
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
cursor=None):
self._cursor_value = None
self._cursor_present = False
if cursor is not None:
self.cursor = cursor
@property
def cursor(self):
"""
The cursor returned by your last call to
:meth:`dropbox.dropbox.Dropbox.sharing_list_folder_members` or
:meth:`dropbox.dropbox.Dropbox.sharing_list_folder_members_continue`.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
raise AttributeError("missing required field 'cursor'")
@cursor.setter
def cursor(self, val):
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFolderMembersContinueArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFolderMembersContinueArg(cursor={!r})'.format(
self._cursor_value,
)
ListFolderMembersContinueArg_validator = bv.Struct(ListFolderMembersContinueArg)
class ListFolderMembersContinueError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFolderMembersContinueError.invalid_cursor:
``ListFolderMembersContinueArg.cursor`` is invalid.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_cursor = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: ListFolderMembersContinueError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_invalid_cursor(self):
"""
Check if the union tag is ``invalid_cursor``.
:rtype: bool
"""
return self._tag == 'invalid_cursor'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFolderMembersContinueError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFolderMembersContinueError(%r, %r)' % (self._tag, self._value)
ListFolderMembersContinueError_validator = bv.Union(ListFolderMembersContinueError)
2019-08-28 21:48:24 +02:00
class ListFoldersArgs(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFoldersArgs.limit: The maximum number of results to return
per request.
:ivar sharing.ListFoldersArgs.actions: A list of `FolderAction`s
corresponding to `FolderPermission`s that should appear in the
response's ``SharedFolderMetadata.permissions`` field describing the
actions the authenticated user can perform on the folder.
"""
__slots__ = [
'_limit_value',
'_limit_present',
'_actions_value',
'_actions_present',
]
_has_required_fields = False
def __init__(self,
limit=None,
actions=None):
self._limit_value = None
self._limit_present = False
self._actions_value = None
self._actions_present = False
if limit is not None:
self.limit = limit
if actions is not None:
self.actions = actions
@property
def limit(self):
"""
The maximum number of results to return per request.
2019-08-28 21:48:24 +02:00
:rtype: int
"""
if self._limit_present:
return self._limit_value
else:
return 1000
@limit.setter
def limit(self, val):
val = self._limit_validator.validate(val)
self._limit_value = val
self._limit_present = True
@limit.deleter
def limit(self):
self._limit_value = None
self._limit_present = False
@property
def actions(self):
"""
A list of `FolderAction`s corresponding to `FolderPermission`s that
should appear in the response's ``SharedFolderMetadata.permissions``
field describing the actions the authenticated user can perform on the
folder.
:rtype: list of [FolderAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFoldersArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFoldersArgs(limit={!r}, actions={!r})'.format(
self._limit_value,
self._actions_value,
)
ListFoldersArgs_validator = bv.Struct(ListFoldersArgs)
2019-08-28 21:48:24 +02:00
class ListFoldersContinueArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFoldersContinueArg.cursor: The cursor returned by the
previous API call specified in the endpoint description.
"""
__slots__ = [
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
cursor=None):
self._cursor_value = None
self._cursor_present = False
if cursor is not None:
self.cursor = cursor
@property
def cursor(self):
"""
The cursor returned by the previous API call specified in the endpoint
description.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
raise AttributeError("missing required field 'cursor'")
@cursor.setter
def cursor(self, val):
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFoldersContinueArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFoldersContinueArg(cursor={!r})'.format(
self._cursor_value,
)
ListFoldersContinueArg_validator = bv.Struct(ListFoldersContinueArg)
class ListFoldersContinueError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFoldersContinueError.invalid_cursor:
``ListFoldersContinueArg.cursor`` is invalid.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_cursor = None
# Attribute is overwritten below the class definition
other = None
def is_invalid_cursor(self):
"""
Check if the union tag is ``invalid_cursor``.
:rtype: bool
"""
return self._tag == 'invalid_cursor'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFoldersContinueError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFoldersContinueError(%r, %r)' % (self._tag, self._value)
ListFoldersContinueError_validator = bv.Union(ListFoldersContinueError)
2019-08-28 21:48:24 +02:00
class ListFoldersResult(bb.Struct):
"""
Result for :meth:`dropbox.dropbox.Dropbox.sharing_list_folders` or
:meth:`dropbox.dropbox.Dropbox.sharing_list_mountable_folders`, depending on
which endpoint was requested. Unmounted shared folders can be identified by
the absence of ``SharedFolderMetadata.path_lower``.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListFoldersResult.entries: List of all shared folders the
authenticated user has access to.
:ivar sharing.ListFoldersResult.cursor: Present if there are additional
shared folders that have not been returned yet. Pass the cursor into the
corresponding continue endpoint (either
:meth:`dropbox.dropbox.Dropbox.sharing_list_folders_continue` or
:meth:`dropbox.dropbox.Dropbox.sharing_list_mountable_folders_continue`)
to list additional folders.
"""
__slots__ = [
'_entries_value',
'_entries_present',
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
entries=None,
cursor=None):
self._entries_value = None
self._entries_present = False
self._cursor_value = None
self._cursor_present = False
if entries is not None:
self.entries = entries
if cursor is not None:
self.cursor = cursor
@property
def entries(self):
"""
List of all shared folders the authenticated user has access to.
:rtype: list of [SharedFolderMetadata]
"""
if self._entries_present:
return self._entries_value
else:
raise AttributeError("missing required field 'entries'")
@entries.setter
def entries(self, val):
val = self._entries_validator.validate(val)
self._entries_value = val
self._entries_present = True
@entries.deleter
def entries(self):
self._entries_value = None
self._entries_present = False
@property
def cursor(self):
"""
Present if there are additional shared folders that have not been
returned yet. Pass the cursor into the corresponding continue endpoint
(either :meth:`dropbox.dropbox.Dropbox.sharing_list_folders_continue` or
:meth:`dropbox.dropbox.Dropbox.sharing_list_mountable_folders_continue`)
to list additional folders.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
return None
@cursor.setter
def cursor(self, val):
if val is None:
del self.cursor
return
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListFoldersResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListFoldersResult(entries={!r}, cursor={!r})'.format(
self._entries_value,
self._cursor_value,
)
ListFoldersResult_validator = bv.Struct(ListFoldersResult)
2019-08-28 21:48:24 +02:00
class ListSharedLinksArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListSharedLinksArg.path: See
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` description.
:ivar sharing.ListSharedLinksArg.cursor: The cursor returned by your last
call to :meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links`.
:ivar sharing.ListSharedLinksArg.direct_only: See
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` description.
"""
__slots__ = [
'_path_value',
'_path_present',
'_cursor_value',
'_cursor_present',
'_direct_only_value',
'_direct_only_present',
]
_has_required_fields = False
def __init__(self,
path=None,
cursor=None,
direct_only=None):
self._path_value = None
self._path_present = False
self._cursor_value = None
self._cursor_present = False
self._direct_only_value = None
self._direct_only_present = False
if path is not None:
self.path = path
if cursor is not None:
self.cursor = cursor
if direct_only is not None:
self.direct_only = direct_only
@property
def path(self):
"""
See :meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links`
description.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
return None
@path.setter
def path(self, val):
if val is None:
del self.path
return
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
@property
def cursor(self):
"""
The cursor returned by your last call to
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links`.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
return None
@cursor.setter
def cursor(self, val):
if val is None:
del self.cursor
return
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
@property
def direct_only(self):
"""
See :meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links`
description.
:rtype: bool
"""
if self._direct_only_present:
return self._direct_only_value
else:
return None
@direct_only.setter
def direct_only(self, val):
if val is None:
del self.direct_only
return
val = self._direct_only_validator.validate(val)
self._direct_only_value = val
self._direct_only_present = True
@direct_only.deleter
def direct_only(self):
self._direct_only_value = None
self._direct_only_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListSharedLinksArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListSharedLinksArg(path={!r}, cursor={!r}, direct_only={!r})'.format(
self._path_value,
self._cursor_value,
self._direct_only_value,
)
ListSharedLinksArg_validator = bv.Struct(ListSharedLinksArg)
class ListSharedLinksError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ListSharedLinksError.reset: Indicates that the cursor has been
invalidated. Call
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` to obtain a
new cursor.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
reset = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def path(cls, val):
"""
Create an instance of this class set to the ``path`` tag with value
``val``.
2019-08-28 21:48:24 +02:00
:param files.LookupError val:
:rtype: ListSharedLinksError
"""
return cls('path', val)
def is_path(self):
"""
Check if the union tag is ``path``.
:rtype: bool
"""
return self._tag == 'path'
def is_reset(self):
"""
Check if the union tag is ``reset``.
:rtype: bool
"""
return self._tag == 'reset'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_path(self):
"""
Only call this if :meth:`is_path` is true.
2019-08-28 21:48:24 +02:00
:rtype: files.LookupError
"""
if not self.is_path():
raise AttributeError("tag 'path' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListSharedLinksError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListSharedLinksError(%r, %r)' % (self._tag, self._value)
ListSharedLinksError_validator = bv.Union(ListSharedLinksError)
2019-08-28 21:48:24 +02:00
class ListSharedLinksResult(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ListSharedLinksResult.links: Shared links applicable to the
path argument.
:ivar sharing.ListSharedLinksResult.has_more: Is true if there are
additional shared links that have not been returned yet. Pass the cursor
into :meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` to
retrieve them.
:ivar sharing.ListSharedLinksResult.cursor: Pass the cursor into
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` to obtain the
additional links. Cursor is returned only if no path is given.
"""
__slots__ = [
'_links_value',
'_links_present',
'_has_more_value',
'_has_more_present',
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
links=None,
has_more=None,
cursor=None):
self._links_value = None
self._links_present = False
self._has_more_value = None
self._has_more_present = False
self._cursor_value = None
self._cursor_present = False
if links is not None:
self.links = links
if has_more is not None:
self.has_more = has_more
if cursor is not None:
self.cursor = cursor
@property
def links(self):
"""
Shared links applicable to the path argument.
:rtype: list of [SharedLinkMetadata]
"""
if self._links_present:
return self._links_value
else:
raise AttributeError("missing required field 'links'")
@links.setter
def links(self, val):
val = self._links_validator.validate(val)
self._links_value = val
self._links_present = True
@links.deleter
def links(self):
self._links_value = None
self._links_present = False
@property
def has_more(self):
"""
Is true if there are additional shared links that have not been returned
yet. Pass the cursor into
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` to retrieve
them.
:rtype: bool
"""
if self._has_more_present:
return self._has_more_value
else:
raise AttributeError("missing required field 'has_more'")
@has_more.setter
def has_more(self, val):
val = self._has_more_validator.validate(val)
self._has_more_value = val
self._has_more_present = True
@has_more.deleter
def has_more(self):
self._has_more_value = None
self._has_more_present = False
@property
def cursor(self):
"""
Pass the cursor into
:meth:`dropbox.dropbox.Dropbox.sharing_list_shared_links` to obtain the
additional links. Cursor is returned only if no path is given.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
return None
@cursor.setter
def cursor(self, val):
if val is None:
del self.cursor
return
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ListSharedLinksResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ListSharedLinksResult(links={!r}, has_more={!r}, cursor={!r})'.format(
self._links_value,
self._has_more_value,
self._cursor_value,
)
ListSharedLinksResult_validator = bv.Struct(ListSharedLinksResult)
2019-08-28 21:48:24 +02:00
class MemberAccessLevelResult(bb.Struct):
"""
Contains information about a member's access level to content after an
operation.
2019-08-28 21:48:24 +02:00
:ivar sharing.MemberAccessLevelResult.access_level: The member still has
this level of access to the content through a parent folder.
:ivar sharing.MemberAccessLevelResult.warning: A localized string with
additional information about why the user has this access level to the
content.
:ivar sharing.MemberAccessLevelResult.access_details: The parent folders
that a member has access to. The field is present if the user has access
to the first parent folder where the member gains access.
"""
__slots__ = [
'_access_level_value',
'_access_level_present',
'_warning_value',
'_warning_present',
'_access_details_value',
'_access_details_present',
]
_has_required_fields = False
def __init__(self,
access_level=None,
warning=None,
access_details=None):
self._access_level_value = None
self._access_level_present = False
self._warning_value = None
self._warning_present = False
self._access_details_value = None
self._access_details_present = False
if access_level is not None:
self.access_level = access_level
if warning is not None:
self.warning = warning
if access_details is not None:
self.access_details = access_details
@property
def access_level(self):
"""
The member still has this level of access to the content through a
parent folder.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
return None
@access_level.setter
def access_level(self, val):
if val is None:
del self.access_level
return
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
@property
def warning(self):
"""
A localized string with additional information about why the user has
this access level to the content.
:rtype: str
"""
if self._warning_present:
return self._warning_value
else:
return None
@warning.setter
def warning(self, val):
if val is None:
del self.warning
return
val = self._warning_validator.validate(val)
self._warning_value = val
self._warning_present = True
@warning.deleter
def warning(self):
self._warning_value = None
self._warning_present = False
@property
def access_details(self):
"""
The parent folders that a member has access to. The field is present if
the user has access to the first parent folder where the member gains
access.
:rtype: list of [ParentFolderAccessInfo]
"""
if self._access_details_present:
return self._access_details_value
else:
return None
@access_details.setter
def access_details(self, val):
if val is None:
del self.access_details
return
val = self._access_details_validator.validate(val)
self._access_details_value = val
self._access_details_present = True
@access_details.deleter
def access_details(self):
self._access_details_value = None
self._access_details_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MemberAccessLevelResult, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MemberAccessLevelResult(access_level={!r}, warning={!r}, access_details={!r})'.format(
self._access_level_value,
self._warning_value,
self._access_details_value,
)
MemberAccessLevelResult_validator = bv.Struct(MemberAccessLevelResult)
class MemberAction(bb.Union):
"""
Actions that may be taken on members of a shared folder.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.MemberAction.leave_a_copy: Allow the member to keep a copy of
the folder when removing.
:ivar sharing.MemberAction.make_editor: Make the member an editor of the
folder.
:ivar sharing.MemberAction.make_owner: Make the member an owner of the
folder.
:ivar sharing.MemberAction.make_viewer: Make the member a viewer of the
folder.
:ivar sharing.MemberAction.make_viewer_no_comment: Make the member a viewer
of the folder without commenting permissions.
:ivar sharing.MemberAction.remove: Remove the member from the folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
leave_a_copy = None
# Attribute is overwritten below the class definition
make_editor = None
# Attribute is overwritten below the class definition
make_owner = None
# Attribute is overwritten below the class definition
make_viewer = None
# Attribute is overwritten below the class definition
make_viewer_no_comment = None
# Attribute is overwritten below the class definition
remove = None
# Attribute is overwritten below the class definition
other = None
def is_leave_a_copy(self):
"""
Check if the union tag is ``leave_a_copy``.
:rtype: bool
"""
return self._tag == 'leave_a_copy'
def is_make_editor(self):
"""
Check if the union tag is ``make_editor``.
:rtype: bool
"""
return self._tag == 'make_editor'
def is_make_owner(self):
"""
Check if the union tag is ``make_owner``.
:rtype: bool
"""
return self._tag == 'make_owner'
def is_make_viewer(self):
"""
Check if the union tag is ``make_viewer``.
:rtype: bool
"""
return self._tag == 'make_viewer'
def is_make_viewer_no_comment(self):
"""
Check if the union tag is ``make_viewer_no_comment``.
:rtype: bool
"""
return self._tag == 'make_viewer_no_comment'
def is_remove(self):
"""
Check if the union tag is ``remove``.
:rtype: bool
"""
return self._tag == 'remove'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MemberAction, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MemberAction(%r, %r)' % (self._tag, self._value)
MemberAction_validator = bv.Union(MemberAction)
2019-08-28 21:48:24 +02:00
class MemberPermission(bb.Struct):
"""
Whether the user is allowed to take the action on the associated member.
2019-08-28 21:48:24 +02:00
:ivar sharing.MemberPermission.action: The action that the user may wish to
take on the member.
:ivar sharing.MemberPermission.allow: True if the user is allowed to take
the action.
:ivar sharing.MemberPermission.reason: The reason why the user is denied the
permission. Not present if the action is allowed.
"""
__slots__ = [
'_action_value',
'_action_present',
'_allow_value',
'_allow_present',
'_reason_value',
'_reason_present',
]
_has_required_fields = True
def __init__(self,
action=None,
allow=None,
reason=None):
self._action_value = None
self._action_present = False
self._allow_value = None
self._allow_present = False
self._reason_value = None
self._reason_present = False
if action is not None:
self.action = action
if allow is not None:
self.allow = allow
if reason is not None:
self.reason = reason
@property
def action(self):
"""
The action that the user may wish to take on the member.
:rtype: MemberAction
"""
if self._action_present:
return self._action_value
else:
raise AttributeError("missing required field 'action'")
@action.setter
def action(self, val):
self._action_validator.validate_type_only(val)
self._action_value = val
self._action_present = True
@action.deleter
def action(self):
self._action_value = None
self._action_present = False
@property
def allow(self):
"""
True if the user is allowed to take the action.
:rtype: bool
"""
if self._allow_present:
return self._allow_value
else:
raise AttributeError("missing required field 'allow'")
@allow.setter
def allow(self, val):
val = self._allow_validator.validate(val)
self._allow_value = val
self._allow_present = True
@allow.deleter
def allow(self):
self._allow_value = None
self._allow_present = False
@property
def reason(self):
"""
The reason why the user is denied the permission. Not present if the
action is allowed.
:rtype: PermissionDeniedReason
"""
if self._reason_present:
return self._reason_value
else:
return None
@reason.setter
def reason(self, val):
if val is None:
del self.reason
return
self._reason_validator.validate_type_only(val)
self._reason_value = val
self._reason_present = True
@reason.deleter
def reason(self):
self._reason_value = None
self._reason_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MemberPermission, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MemberPermission(action={!r}, allow={!r}, reason={!r})'.format(
self._action_value,
self._allow_value,
self._reason_value,
)
MemberPermission_validator = bv.Struct(MemberPermission)
class MemberPolicy(bb.Union):
"""
Policy governing who can be a member of a shared folder. Only applicable to
folders owned by a user on a 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.
2019-08-28 21:48:24 +02:00
:ivar sharing.MemberPolicy.team: Only a teammate can become a member.
:ivar sharing.MemberPolicy.anyone: Anyone can become a member.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
team = None
# Attribute is overwritten below the class definition
anyone = None
# Attribute is overwritten below the class definition
other = None
def is_team(self):
"""
Check if the union tag is ``team``.
:rtype: bool
"""
return self._tag == 'team'
def is_anyone(self):
"""
Check if the union tag is ``anyone``.
:rtype: bool
"""
return self._tag == 'anyone'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MemberPolicy, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MemberPolicy(%r, %r)' % (self._tag, self._value)
MemberPolicy_validator = bv.Union(MemberPolicy)
class MemberSelector(bb.Union):
"""
Includes different ways to identify a member of a shared folder.
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.
2019-08-28 21:48:24 +02:00
:ivar str sharing.MemberSelector.dropbox_id: Dropbox account, team member,
or group ID of member.
:ivar str sharing.MemberSelector.email: E-mail address of member.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def dropbox_id(cls, val):
"""
Create an instance of this class set to the ``dropbox_id`` tag with
value ``val``.
:param str val:
:rtype: MemberSelector
"""
return cls('dropbox_id', val)
@classmethod
def email(cls, val):
"""
Create an instance of this class set to the ``email`` tag with value
``val``.
:param str val:
:rtype: MemberSelector
"""
return cls('email', val)
def is_dropbox_id(self):
"""
Check if the union tag is ``dropbox_id``.
:rtype: bool
"""
return self._tag == 'dropbox_id'
def is_email(self):
"""
Check if the union tag is ``email``.
:rtype: bool
"""
return self._tag == 'email'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_dropbox_id(self):
"""
Dropbox account, team member, or group ID of member.
Only call this if :meth:`is_dropbox_id` is true.
:rtype: str
"""
if not self.is_dropbox_id():
raise AttributeError("tag 'dropbox_id' not set")
return self._value
def get_email(self):
"""
E-mail address of member.
Only call this if :meth:`is_email` is true.
:rtype: str
"""
if not self.is_email():
raise AttributeError("tag 'email' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MemberSelector, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MemberSelector(%r, %r)' % (self._tag, self._value)
MemberSelector_validator = bv.Union(MemberSelector)
2019-08-28 21:48:24 +02:00
class ModifySharedLinkSettingsArgs(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ModifySharedLinkSettingsArgs.url: URL of the shared link to
change its settings.
:ivar sharing.ModifySharedLinkSettingsArgs.settings: Set of settings for the
shared link.
2019-08-28 21:48:24 +02:00
:ivar sharing.ModifySharedLinkSettingsArgs.remove_expiration: If set to
true, removes the expiration of the shared link.
"""
__slots__ = [
'_url_value',
'_url_present',
'_settings_value',
'_settings_present',
'_remove_expiration_value',
'_remove_expiration_present',
]
_has_required_fields = True
def __init__(self,
url=None,
settings=None,
remove_expiration=None):
self._url_value = None
self._url_present = False
self._settings_value = None
self._settings_present = False
self._remove_expiration_value = None
self._remove_expiration_present = False
if url is not None:
self.url = url
if settings is not None:
self.settings = settings
if remove_expiration is not None:
self.remove_expiration = remove_expiration
@property
def url(self):
"""
URL of the shared link to change its settings.
:rtype: str
"""
if self._url_present:
return self._url_value
else:
raise AttributeError("missing required field 'url'")
@url.setter
def url(self, val):
val = self._url_validator.validate(val)
self._url_value = val
self._url_present = True
@url.deleter
def url(self):
self._url_value = None
self._url_present = False
@property
def settings(self):
"""
Set of settings for the shared link.
:rtype: SharedLinkSettings
"""
if self._settings_present:
return self._settings_value
else:
raise AttributeError("missing required field 'settings'")
@settings.setter
def settings(self, val):
self._settings_validator.validate_type_only(val)
self._settings_value = val
self._settings_present = True
@settings.deleter
def settings(self):
self._settings_value = None
self._settings_present = False
@property
def remove_expiration(self):
"""
If set to true, removes the expiration of the shared link.
:rtype: bool
"""
if self._remove_expiration_present:
return self._remove_expiration_value
else:
return False
@remove_expiration.setter
def remove_expiration(self, val):
val = self._remove_expiration_validator.validate(val)
self._remove_expiration_value = val
self._remove_expiration_present = True
@remove_expiration.deleter
def remove_expiration(self):
self._remove_expiration_value = None
self._remove_expiration_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ModifySharedLinkSettingsArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ModifySharedLinkSettingsArgs(url={!r}, settings={!r}, remove_expiration={!r})'.format(
self._url_value,
self._settings_value,
self._remove_expiration_value,
)
ModifySharedLinkSettingsArgs_validator = bv.Struct(ModifySharedLinkSettingsArgs)
class ModifySharedLinkSettingsError(SharedLinkError):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar SharedLinkSettingsError ModifySharedLinkSettingsError.settings_error:
There is an error with the given settings.
:ivar sharing.ModifySharedLinkSettingsError.email_not_verified: The caller's
email should be verified.
"""
# Attribute is overwritten below the class definition
email_not_verified = None
@classmethod
def settings_error(cls, val):
"""
Create an instance of this class set to the ``settings_error`` tag with
value ``val``.
:param SharedLinkSettingsError val:
:rtype: ModifySharedLinkSettingsError
"""
return cls('settings_error', val)
def is_settings_error(self):
"""
Check if the union tag is ``settings_error``.
:rtype: bool
"""
return self._tag == 'settings_error'
def is_email_not_verified(self):
"""
Check if the union tag is ``email_not_verified``.
:rtype: bool
"""
return self._tag == 'email_not_verified'
def get_settings_error(self):
"""
There is an error with the given settings.
Only call this if :meth:`is_settings_error` is true.
:rtype: SharedLinkSettingsError
"""
if not self.is_settings_error():
raise AttributeError("tag 'settings_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ModifySharedLinkSettingsError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ModifySharedLinkSettingsError(%r, %r)' % (self._tag, self._value)
ModifySharedLinkSettingsError_validator = bv.Union(ModifySharedLinkSettingsError)
2019-08-28 21:48:24 +02:00
class MountFolderArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.MountFolderArg.shared_folder_id: The ID of the shared folder
to mount.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
@property
def shared_folder_id(self):
"""
The ID of the shared folder to mount.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MountFolderArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MountFolderArg(shared_folder_id={!r})'.format(
self._shared_folder_id_value,
)
MountFolderArg_validator = bv.Struct(MountFolderArg)
class MountFolderError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.MountFolderError.inside_shared_folder: Mounting would cause a
shared folder to be inside another, which is disallowed.
:ivar InsufficientQuotaAmounts MountFolderError.insufficient_quota: The
current user does not have enough space to mount the shared folder.
:ivar sharing.MountFolderError.already_mounted: The shared folder is already
mounted.
:ivar sharing.MountFolderError.no_permission: The current user does not have
permission to perform this action.
:ivar sharing.MountFolderError.not_mountable: The shared folder is not
mountable. One example where this can occur is when the shared folder
belongs within a team folder in the user's Dropbox.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
inside_shared_folder = None
# Attribute is overwritten below the class definition
already_mounted = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
not_mountable = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: MountFolderError
"""
return cls('access_error', val)
@classmethod
def insufficient_quota(cls, val):
"""
Create an instance of this class set to the ``insufficient_quota`` tag
with value ``val``.
:param InsufficientQuotaAmounts val:
:rtype: MountFolderError
"""
return cls('insufficient_quota', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_inside_shared_folder(self):
"""
Check if the union tag is ``inside_shared_folder``.
:rtype: bool
"""
return self._tag == 'inside_shared_folder'
def is_insufficient_quota(self):
"""
Check if the union tag is ``insufficient_quota``.
:rtype: bool
"""
return self._tag == 'insufficient_quota'
def is_already_mounted(self):
"""
Check if the union tag is ``already_mounted``.
:rtype: bool
"""
return self._tag == 'already_mounted'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_not_mountable(self):
"""
Check if the union tag is ``not_mountable``.
:rtype: bool
"""
return self._tag == 'not_mountable'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def get_insufficient_quota(self):
"""
The current user does not have enough space to mount the shared folder.
Only call this if :meth:`is_insufficient_quota` is true.
:rtype: InsufficientQuotaAmounts
"""
if not self.is_insufficient_quota():
raise AttributeError("tag 'insufficient_quota' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(MountFolderError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'MountFolderError(%r, %r)' % (self._tag, self._value)
MountFolderError_validator = bv.Union(MountFolderError)
2019-08-28 21:48:24 +02:00
class ParentFolderAccessInfo(bb.Struct):
"""
Contains information about a parent folder that a member has access to.
2019-08-28 21:48:24 +02:00
:ivar sharing.ParentFolderAccessInfo.folder_name: Display name for the
folder.
:ivar sharing.ParentFolderAccessInfo.shared_folder_id: The identifier of the
parent shared folder.
:ivar sharing.ParentFolderAccessInfo.permissions: The user's permissions for
the parent shared folder.
:ivar sharing.ParentFolderAccessInfo.path: The full path to the parent
shared folder relative to the acting user's root.
"""
__slots__ = [
'_folder_name_value',
'_folder_name_present',
'_shared_folder_id_value',
'_shared_folder_id_present',
'_permissions_value',
'_permissions_present',
'_path_value',
'_path_present',
]
_has_required_fields = True
def __init__(self,
folder_name=None,
shared_folder_id=None,
permissions=None,
path=None):
self._folder_name_value = None
self._folder_name_present = False
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._permissions_value = None
self._permissions_present = False
self._path_value = None
self._path_present = False
if folder_name is not None:
self.folder_name = folder_name
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if permissions is not None:
self.permissions = permissions
if path is not None:
self.path = path
@property
def folder_name(self):
"""
Display name for the folder.
:rtype: str
"""
if self._folder_name_present:
return self._folder_name_value
else:
raise AttributeError("missing required field 'folder_name'")
@folder_name.setter
def folder_name(self, val):
val = self._folder_name_validator.validate(val)
self._folder_name_value = val
self._folder_name_present = True
@folder_name.deleter
def folder_name(self):
self._folder_name_value = None
self._folder_name_present = False
@property
def shared_folder_id(self):
"""
The identifier of the parent shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def permissions(self):
"""
The user's permissions for the parent shared folder.
:rtype: list of [MemberPermission]
"""
if self._permissions_present:
return self._permissions_value
else:
raise AttributeError("missing required field 'permissions'")
@permissions.setter
def permissions(self, val):
val = self._permissions_validator.validate(val)
self._permissions_value = val
self._permissions_present = True
@permissions.deleter
def permissions(self):
self._permissions_value = None
self._permissions_present = False
@property
def path(self):
"""
The full path to the parent shared folder relative to the acting user's
root.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
raise AttributeError("missing required field 'path'")
@path.setter
def path(self, val):
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ParentFolderAccessInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ParentFolderAccessInfo(folder_name={!r}, shared_folder_id={!r}, permissions={!r}, path={!r})'.format(
self._folder_name_value,
self._shared_folder_id_value,
self._permissions_value,
self._path_value,
)
ParentFolderAccessInfo_validator = bv.Struct(ParentFolderAccessInfo)
class PathLinkMetadata(LinkMetadata):
"""
Metadata for a path-based shared link.
2019-08-28 21:48:24 +02:00
:ivar sharing.PathLinkMetadata.path: Path in user's Dropbox.
"""
__slots__ = [
'_path_value',
'_path_present',
]
_has_required_fields = True
def __init__(self,
url=None,
visibility=None,
path=None,
expires=None):
super(PathLinkMetadata, self).__init__(url,
visibility,
expires)
self._path_value = None
self._path_present = False
if path is not None:
self.path = path
@property
def path(self):
"""
Path in user's Dropbox.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
raise AttributeError("missing required field 'path'")
@path.setter
def path(self, val):
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PathLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PathLinkMetadata(url={!r}, visibility={!r}, path={!r}, expires={!r})'.format(
self._url_value,
self._visibility_value,
self._path_value,
self._expires_value,
)
PathLinkMetadata_validator = bv.Struct(PathLinkMetadata)
class PendingUploadMode(bb.Union):
"""
Flag to indicate pending upload default (for linking to not-yet-existing
paths).
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.PendingUploadMode.file: Assume pending uploads are files.
:ivar sharing.PendingUploadMode.folder: Assume pending uploads are folders.
"""
_catch_all = None
# Attribute is overwritten below the class definition
file = None
# Attribute is overwritten below the class definition
folder = None
def is_file(self):
"""
Check if the union tag is ``file``.
:rtype: bool
"""
return self._tag == 'file'
def is_folder(self):
"""
Check if the union tag is ``folder``.
:rtype: bool
"""
return self._tag == 'folder'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PendingUploadMode, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PendingUploadMode(%r, %r)' % (self._tag, self._value)
PendingUploadMode_validator = bv.Union(PendingUploadMode)
class PermissionDeniedReason(bb.Union):
"""
Possible reasons the user is denied a permission.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.PermissionDeniedReason.user_not_same_team_as_owner: User is
not on the same team as the folder owner.
:ivar sharing.PermissionDeniedReason.user_not_allowed_by_owner: User is
prohibited by the owner from taking the action.
:ivar sharing.PermissionDeniedReason.target_is_indirect_member: Target is
indirectly a member of the folder, for example by being part of a group.
:ivar sharing.PermissionDeniedReason.target_is_owner: Target is the owner of
the folder.
:ivar sharing.PermissionDeniedReason.target_is_self: Target is the user
itself.
:ivar sharing.PermissionDeniedReason.target_not_active: Target is not an
active member of the team.
:ivar sharing.PermissionDeniedReason.folder_is_limited_team_folder: Folder
is team folder for a limited team.
:ivar sharing.PermissionDeniedReason.owner_not_on_team: The content owner
needs to be on a Dropbox team to perform this action.
:ivar sharing.PermissionDeniedReason.permission_denied: The user does not
have permission to perform this action on the link.
:ivar sharing.PermissionDeniedReason.restricted_by_team: The user's team
policy prevents performing this action on the link.
:ivar sharing.PermissionDeniedReason.user_account_type: The user's account
type does not support this action.
:ivar sharing.PermissionDeniedReason.user_not_on_team: The user needs to be
on a Dropbox team to perform this action.
:ivar sharing.PermissionDeniedReason.folder_is_inside_shared_folder: Folder
is inside of another shared folder.
:ivar sharing.PermissionDeniedReason.restricted_by_parent_folder: Policy
cannot be changed due to restrictions from parent folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
user_not_same_team_as_owner = None
# Attribute is overwritten below the class definition
user_not_allowed_by_owner = None
# Attribute is overwritten below the class definition
target_is_indirect_member = None
# Attribute is overwritten below the class definition
target_is_owner = None
# Attribute is overwritten below the class definition
target_is_self = None
# Attribute is overwritten below the class definition
target_not_active = None
# Attribute is overwritten below the class definition
folder_is_limited_team_folder = None
# Attribute is overwritten below the class definition
owner_not_on_team = None
# Attribute is overwritten below the class definition
permission_denied = None
# Attribute is overwritten below the class definition
restricted_by_team = None
# Attribute is overwritten below the class definition
user_account_type = None
# Attribute is overwritten below the class definition
user_not_on_team = None
# Attribute is overwritten below the class definition
folder_is_inside_shared_folder = None
# Attribute is overwritten below the class definition
restricted_by_parent_folder = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def insufficient_plan(cls, val):
"""
Create an instance of this class set to the ``insufficient_plan`` tag
with value ``val``.
:param InsufficientPlan val:
:rtype: PermissionDeniedReason
"""
return cls('insufficient_plan', val)
def is_user_not_same_team_as_owner(self):
"""
Check if the union tag is ``user_not_same_team_as_owner``.
:rtype: bool
"""
return self._tag == 'user_not_same_team_as_owner'
def is_user_not_allowed_by_owner(self):
"""
Check if the union tag is ``user_not_allowed_by_owner``.
:rtype: bool
"""
return self._tag == 'user_not_allowed_by_owner'
def is_target_is_indirect_member(self):
"""
Check if the union tag is ``target_is_indirect_member``.
:rtype: bool
"""
return self._tag == 'target_is_indirect_member'
def is_target_is_owner(self):
"""
Check if the union tag is ``target_is_owner``.
:rtype: bool
"""
return self._tag == 'target_is_owner'
def is_target_is_self(self):
"""
Check if the union tag is ``target_is_self``.
:rtype: bool
"""
return self._tag == 'target_is_self'
def is_target_not_active(self):
"""
Check if the union tag is ``target_not_active``.
:rtype: bool
"""
return self._tag == 'target_not_active'
def is_folder_is_limited_team_folder(self):
"""
Check if the union tag is ``folder_is_limited_team_folder``.
:rtype: bool
"""
return self._tag == 'folder_is_limited_team_folder'
def is_owner_not_on_team(self):
"""
Check if the union tag is ``owner_not_on_team``.
:rtype: bool
"""
return self._tag == 'owner_not_on_team'
def is_permission_denied(self):
"""
Check if the union tag is ``permission_denied``.
:rtype: bool
"""
return self._tag == 'permission_denied'
def is_restricted_by_team(self):
"""
Check if the union tag is ``restricted_by_team``.
:rtype: bool
"""
return self._tag == 'restricted_by_team'
def is_user_account_type(self):
"""
Check if the union tag is ``user_account_type``.
:rtype: bool
"""
return self._tag == 'user_account_type'
def is_user_not_on_team(self):
"""
Check if the union tag is ``user_not_on_team``.
:rtype: bool
"""
return self._tag == 'user_not_on_team'
def is_folder_is_inside_shared_folder(self):
"""
Check if the union tag is ``folder_is_inside_shared_folder``.
:rtype: bool
"""
return self._tag == 'folder_is_inside_shared_folder'
def is_restricted_by_parent_folder(self):
"""
Check if the union tag is ``restricted_by_parent_folder``.
:rtype: bool
"""
return self._tag == 'restricted_by_parent_folder'
def is_insufficient_plan(self):
"""
Check if the union tag is ``insufficient_plan``.
:rtype: bool
"""
return self._tag == 'insufficient_plan'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_insufficient_plan(self):
"""
Only call this if :meth:`is_insufficient_plan` is true.
:rtype: InsufficientPlan
"""
if not self.is_insufficient_plan():
raise AttributeError("tag 'insufficient_plan' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(PermissionDeniedReason, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'PermissionDeniedReason(%r, %r)' % (self._tag, self._value)
PermissionDeniedReason_validator = bv.Union(PermissionDeniedReason)
2019-08-28 21:48:24 +02:00
class RelinquishFileMembershipArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.RelinquishFileMembershipArg.file: The path or id for the file.
"""
__slots__ = [
'_file_value',
'_file_present',
]
_has_required_fields = True
def __init__(self,
file=None):
self._file_value = None
self._file_present = False
if file is not None:
self.file = file
@property
def file(self):
"""
The path or id for the file.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RelinquishFileMembershipArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RelinquishFileMembershipArg(file={!r})'.format(
self._file_value,
)
RelinquishFileMembershipArg_validator = bv.Struct(RelinquishFileMembershipArg)
class RelinquishFileMembershipError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.RelinquishFileMembershipError.group_access: The current user
has access to the shared file via a group. You can't relinquish
membership to a file shared via groups.
:ivar sharing.RelinquishFileMembershipError.no_permission: The current user
does not have permission to perform this action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
group_access = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: RelinquishFileMembershipError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_group_access(self):
"""
Check if the union tag is ``group_access``.
:rtype: bool
"""
return self._tag == 'group_access'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RelinquishFileMembershipError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RelinquishFileMembershipError(%r, %r)' % (self._tag, self._value)
RelinquishFileMembershipError_validator = bv.Union(RelinquishFileMembershipError)
2019-08-28 21:48:24 +02:00
class RelinquishFolderMembershipArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.RelinquishFolderMembershipArg.shared_folder_id: The ID for the
shared folder.
:ivar sharing.RelinquishFolderMembershipArg.leave_a_copy: Keep a copy of the
folder's contents upon relinquishing membership.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_leave_a_copy_value',
'_leave_a_copy_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
leave_a_copy=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._leave_a_copy_value = None
self._leave_a_copy_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if leave_a_copy is not None:
self.leave_a_copy = leave_a_copy
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def leave_a_copy(self):
"""
Keep a copy of the folder's contents upon relinquishing membership.
:rtype: bool
"""
if self._leave_a_copy_present:
return self._leave_a_copy_value
else:
return False
@leave_a_copy.setter
def leave_a_copy(self, val):
val = self._leave_a_copy_validator.validate(val)
self._leave_a_copy_value = val
self._leave_a_copy_present = True
@leave_a_copy.deleter
def leave_a_copy(self):
self._leave_a_copy_value = None
self._leave_a_copy_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RelinquishFolderMembershipArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RelinquishFolderMembershipArg(shared_folder_id={!r}, leave_a_copy={!r})'.format(
self._shared_folder_id_value,
self._leave_a_copy_value,
)
RelinquishFolderMembershipArg_validator = bv.Struct(RelinquishFolderMembershipArg)
class RelinquishFolderMembershipError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.RelinquishFolderMembershipError.folder_owner: The current user
is the owner of the shared folder. Owners cannot relinquish membership
to their own folders. Try unsharing or transferring ownership first.
:ivar sharing.RelinquishFolderMembershipError.mounted: The shared folder is
currently mounted. Unmount the shared folder before relinquishing
membership.
:ivar sharing.RelinquishFolderMembershipError.group_access: The current user
has access to the shared folder via a group. You can't relinquish
membership to folders shared via groups.
:ivar sharing.RelinquishFolderMembershipError.team_folder: This action
cannot be performed on a team shared folder.
:ivar sharing.RelinquishFolderMembershipError.no_permission: The current
user does not have permission to perform this action.
:ivar sharing.RelinquishFolderMembershipError.no_explicit_access: The
current user only has inherited access to the shared folder. You can't
relinquish inherited membership to folders.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
folder_owner = None
# Attribute is overwritten below the class definition
mounted = None
# Attribute is overwritten below the class definition
group_access = None
# Attribute is overwritten below the class definition
team_folder = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
no_explicit_access = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: RelinquishFolderMembershipError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_folder_owner(self):
"""
Check if the union tag is ``folder_owner``.
:rtype: bool
"""
return self._tag == 'folder_owner'
def is_mounted(self):
"""
Check if the union tag is ``mounted``.
:rtype: bool
"""
return self._tag == 'mounted'
def is_group_access(self):
"""
Check if the union tag is ``group_access``.
:rtype: bool
"""
return self._tag == 'group_access'
def is_team_folder(self):
"""
Check if the union tag is ``team_folder``.
:rtype: bool
"""
return self._tag == 'team_folder'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_no_explicit_access(self):
"""
Check if the union tag is ``no_explicit_access``.
:rtype: bool
"""
return self._tag == 'no_explicit_access'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RelinquishFolderMembershipError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RelinquishFolderMembershipError(%r, %r)' % (self._tag, self._value)
RelinquishFolderMembershipError_validator = bv.Union(RelinquishFolderMembershipError)
2019-08-28 21:48:24 +02:00
class RemoveFileMemberArg(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.sharing_remove_file_member_2`.
2019-08-28 21:48:24 +02:00
:ivar sharing.RemoveFileMemberArg.file: File from which to remove members.
:ivar sharing.RemoveFileMemberArg.member: Member to remove from this file.
Note that even if an email is specified, it may result in the removal of
a user (not an invitee) if the user's main account corresponds to that
email address.
"""
__slots__ = [
'_file_value',
'_file_present',
'_member_value',
'_member_present',
]
_has_required_fields = True
def __init__(self,
file=None,
member=None):
self._file_value = None
self._file_present = False
self._member_value = None
self._member_present = False
if file is not None:
self.file = file
if member is not None:
self.member = member
@property
def file(self):
"""
File from which to remove members.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
@property
def member(self):
"""
Member to remove from this file. Note that even if an email is
specified, it may result in the removal of a user (not an invitee) if
the user's main account corresponds to that email address.
:rtype: MemberSelector
"""
if self._member_present:
return self._member_value
else:
raise AttributeError("missing required field 'member'")
@member.setter
def member(self, val):
self._member_validator.validate_type_only(val)
self._member_value = val
self._member_present = True
@member.deleter
def member(self):
self._member_value = None
self._member_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemoveFileMemberArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RemoveFileMemberArg(file={!r}, member={!r})'.format(
self._file_value,
self._member_value,
)
RemoveFileMemberArg_validator = bv.Struct(RemoveFileMemberArg)
class RemoveFileMemberError(bb.Union):
"""
Errors for :meth:`dropbox.dropbox.Dropbox.sharing_remove_file_member_2`.
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.
2019-08-28 21:48:24 +02:00
:ivar MemberAccessLevelResult RemoveFileMemberError.no_explicit_access: This
member does not have explicit access to the file and therefore cannot be
removed. The return value is the access that a user might have to the
file from a parent folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: RemoveFileMemberError
"""
return cls('user_error', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: RemoveFileMemberError
"""
return cls('access_error', val)
@classmethod
def no_explicit_access(cls, val):
"""
Create an instance of this class set to the ``no_explicit_access`` tag
with value ``val``.
:param MemberAccessLevelResult val:
:rtype: RemoveFileMemberError
"""
return cls('no_explicit_access', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_no_explicit_access(self):
"""
Check if the union tag is ``no_explicit_access``.
:rtype: bool
"""
return self._tag == 'no_explicit_access'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def get_no_explicit_access(self):
"""
This member does not have explicit access to the file and therefore
cannot be removed. The return value is the access that a user might have
to the file from a parent folder.
Only call this if :meth:`is_no_explicit_access` is true.
:rtype: MemberAccessLevelResult
"""
if not self.is_no_explicit_access():
raise AttributeError("tag 'no_explicit_access' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemoveFileMemberError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RemoveFileMemberError(%r, %r)' % (self._tag, self._value)
RemoveFileMemberError_validator = bv.Union(RemoveFileMemberError)
2019-08-28 21:48:24 +02:00
class RemoveFolderMemberArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.RemoveFolderMemberArg.shared_folder_id: The ID for the shared
folder.
:ivar sharing.RemoveFolderMemberArg.member: The member to remove from the
folder.
:ivar sharing.RemoveFolderMemberArg.leave_a_copy: If true, the removed user
will keep their copy of the folder after it's unshared, assuming it was
mounted. Otherwise, it will be removed from their Dropbox. Also, this
must be set to false when kicking a group.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_member_value',
'_member_present',
'_leave_a_copy_value',
'_leave_a_copy_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
member=None,
leave_a_copy=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._member_value = None
self._member_present = False
self._leave_a_copy_value = None
self._leave_a_copy_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if member is not None:
self.member = member
if leave_a_copy is not None:
self.leave_a_copy = leave_a_copy
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def member(self):
"""
The member to remove from the folder.
:rtype: MemberSelector
"""
if self._member_present:
return self._member_value
else:
raise AttributeError("missing required field 'member'")
@member.setter
def member(self, val):
self._member_validator.validate_type_only(val)
self._member_value = val
self._member_present = True
@member.deleter
def member(self):
self._member_value = None
self._member_present = False
@property
def leave_a_copy(self):
"""
If true, the removed user will keep their copy of the folder after it's
unshared, assuming it was mounted. Otherwise, it will be removed from
their Dropbox. Also, this must be set to false when kicking a group.
:rtype: bool
"""
if self._leave_a_copy_present:
return self._leave_a_copy_value
else:
raise AttributeError("missing required field 'leave_a_copy'")
@leave_a_copy.setter
def leave_a_copy(self, val):
val = self._leave_a_copy_validator.validate(val)
self._leave_a_copy_value = val
self._leave_a_copy_present = True
@leave_a_copy.deleter
def leave_a_copy(self):
self._leave_a_copy_value = None
self._leave_a_copy_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemoveFolderMemberArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RemoveFolderMemberArg(shared_folder_id={!r}, member={!r}, leave_a_copy={!r})'.format(
self._shared_folder_id_value,
self._member_value,
self._leave_a_copy_value,
)
RemoveFolderMemberArg_validator = bv.Struct(RemoveFolderMemberArg)
class RemoveFolderMemberError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.RemoveFolderMemberError.folder_owner: The target user is the
owner of the shared folder. You can't remove this user until ownership
has been transferred to another member.
:ivar sharing.RemoveFolderMemberError.group_access: The target user has
access to the shared folder via a group.
:ivar sharing.RemoveFolderMemberError.team_folder: This action cannot be
performed on a team shared folder.
:ivar sharing.RemoveFolderMemberError.no_permission: The current user does
not have permission to perform this action.
:ivar sharing.RemoveFolderMemberError.too_many_files: This shared folder has
too many files for leaving a copy. You can still remove this user
without leaving a copy.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
folder_owner = None
# Attribute is overwritten below the class definition
group_access = None
# Attribute is overwritten below the class definition
team_folder = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
2019-08-28 21:48:24 +02:00
too_many_files = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: RemoveFolderMemberError
"""
return cls('access_error', val)
@classmethod
def member_error(cls, val):
"""
Create an instance of this class set to the ``member_error`` tag with
value ``val``.
:param SharedFolderMemberError val:
:rtype: RemoveFolderMemberError
"""
return cls('member_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_member_error(self):
"""
Check if the union tag is ``member_error``.
:rtype: bool
"""
return self._tag == 'member_error'
def is_folder_owner(self):
"""
Check if the union tag is ``folder_owner``.
:rtype: bool
"""
return self._tag == 'folder_owner'
def is_group_access(self):
"""
Check if the union tag is ``group_access``.
:rtype: bool
"""
return self._tag == 'group_access'
def is_team_folder(self):
"""
Check if the union tag is ``team_folder``.
:rtype: bool
"""
return self._tag == 'team_folder'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
2019-08-28 21:48:24 +02:00
def is_too_many_files(self):
"""
Check if the union tag is ``too_many_files``.
:rtype: bool
"""
return self._tag == 'too_many_files'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def get_member_error(self):
"""
Only call this if :meth:`is_member_error` is true.
:rtype: SharedFolderMemberError
"""
if not self.is_member_error():
raise AttributeError("tag 'member_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemoveFolderMemberError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RemoveFolderMemberError(%r, %r)' % (self._tag, self._value)
RemoveFolderMemberError_validator = bv.Union(RemoveFolderMemberError)
2019-08-28 21:48:24 +02:00
class RemoveMemberJobStatus(async_.PollResultBase):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar MemberAccessLevelResult RemoveMemberJobStatus.complete: Removing the
folder member has finished. The value is information about whether the
member has another form of access.
"""
@classmethod
def complete(cls, val):
"""
Create an instance of this class set to the ``complete`` tag with value
``val``.
:param MemberAccessLevelResult val:
:rtype: RemoveMemberJobStatus
"""
return cls('complete', val)
@classmethod
def failed(cls, val):
"""
Create an instance of this class set to the ``failed`` tag with value
``val``.
:param RemoveFolderMemberError val:
:rtype: RemoveMemberJobStatus
"""
return cls('failed', val)
def is_complete(self):
"""
Check if the union tag is ``complete``.
:rtype: bool
"""
return self._tag == 'complete'
def is_failed(self):
"""
Check if the union tag is ``failed``.
:rtype: bool
"""
return self._tag == 'failed'
def get_complete(self):
"""
Removing the folder member has finished. The value is information about
whether the member has another form of access.
Only call this if :meth:`is_complete` is true.
:rtype: MemberAccessLevelResult
"""
if not self.is_complete():
raise AttributeError("tag 'complete' not set")
return self._value
def get_failed(self):
"""
Only call this if :meth:`is_failed` is true.
:rtype: RemoveFolderMemberError
"""
if not self.is_failed():
raise AttributeError("tag 'failed' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RemoveMemberJobStatus, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RemoveMemberJobStatus(%r, %r)' % (self._tag, self._value)
RemoveMemberJobStatus_validator = bv.Union(RemoveMemberJobStatus)
2019-08-28 21:48:24 +02:00
class RequestedLinkAccessLevel(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 sharing.RequestedLinkAccessLevel.viewer: Users who use the link can
view and comment on the content.
:ivar sharing.RequestedLinkAccessLevel.editor: Users who use the link can
edit, view and comment on the content.
:ivar sharing.RequestedLinkAccessLevel.max: Request for the maximum access
level you can set the link to.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
viewer = None
# Attribute is overwritten below the class definition
editor = None
# Attribute is overwritten below the class definition
max = None
# Attribute is overwritten below the class definition
other = None
def is_viewer(self):
"""
Check if the union tag is ``viewer``.
:rtype: bool
"""
return self._tag == 'viewer'
def is_editor(self):
"""
Check if the union tag is ``editor``.
:rtype: bool
"""
return self._tag == 'editor'
def is_max(self):
"""
Check if the union tag is ``max``.
:rtype: bool
"""
return self._tag == 'max'
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(RequestedLinkAccessLevel, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RequestedLinkAccessLevel(%r, %r)' % (self._tag, self._value)
RequestedLinkAccessLevel_validator = bv.Union(RequestedLinkAccessLevel)
class RequestedVisibility(bb.Union):
"""
The access permission that can be requested by the caller for the shared
link. Note that the final resolved visibility of the shared link takes into
account other aspects, such as team and shared folder settings. Check the
:class:`ResolvedVisibility` for more info on the possible resolved
visibility values of shared links.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.RequestedVisibility.public: Anyone who has received the link
can access it. No login required.
:ivar sharing.RequestedVisibility.team_only: Only members of the same team
can access the link. Login is required.
:ivar sharing.RequestedVisibility.password: A link-specific password is
required to access the link. Login is not required.
"""
_catch_all = None
# Attribute is overwritten below the class definition
public = None
# Attribute is overwritten below the class definition
team_only = None
# Attribute is overwritten below the class definition
password = None
def is_public(self):
"""
Check if the union tag is ``public``.
:rtype: bool
"""
return self._tag == 'public'
def is_team_only(self):
"""
Check if the union tag is ``team_only``.
:rtype: bool
"""
return self._tag == 'team_only'
def is_password(self):
"""
Check if the union tag is ``password``.
:rtype: bool
"""
return self._tag == 'password'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RequestedVisibility, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RequestedVisibility(%r, %r)' % (self._tag, self._value)
RequestedVisibility_validator = bv.Union(RequestedVisibility)
class ResolvedVisibility(RequestedVisibility):
"""
The actual access permissions values of shared links after taking into
account user preferences and the team and shared folder settings. Check the
:class:`RequestedVisibility` for more info on the possible visibility values
that can be set by the shared link's owner.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ResolvedVisibility.team_and_password: Only members of the same
team who have the link-specific password can access the link. Login is
required.
:ivar sharing.ResolvedVisibility.shared_folder_only: Only members of the
shared folder containing the linked file can access the link. Login is
required.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
team_and_password = None
# Attribute is overwritten below the class definition
shared_folder_only = None
# Attribute is overwritten below the class definition
other = None
def is_team_and_password(self):
"""
Check if the union tag is ``team_and_password``.
:rtype: bool
"""
return self._tag == 'team_and_password'
def is_shared_folder_only(self):
"""
Check if the union tag is ``shared_folder_only``.
:rtype: bool
"""
return self._tag == 'shared_folder_only'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ResolvedVisibility, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ResolvedVisibility(%r, %r)' % (self._tag, self._value)
ResolvedVisibility_validator = bv.Union(ResolvedVisibility)
2019-08-28 21:48:24 +02:00
class RevokeSharedLinkArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.RevokeSharedLinkArg.url: URL of the shared link.
"""
__slots__ = [
'_url_value',
'_url_present',
]
_has_required_fields = True
def __init__(self,
url=None):
self._url_value = None
self._url_present = False
if url is not None:
self.url = url
@property
def url(self):
"""
URL of the shared link.
:rtype: str
"""
if self._url_present:
return self._url_value
else:
raise AttributeError("missing required field 'url'")
@url.setter
def url(self, val):
val = self._url_validator.validate(val)
self._url_value = val
self._url_present = True
@url.deleter
def url(self):
self._url_value = None
self._url_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RevokeSharedLinkArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RevokeSharedLinkArg(url={!r})'.format(
self._url_value,
)
RevokeSharedLinkArg_validator = bv.Struct(RevokeSharedLinkArg)
class RevokeSharedLinkError(SharedLinkError):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.RevokeSharedLinkError.shared_link_malformed: Shared link is
malformed.
"""
# Attribute is overwritten below the class definition
shared_link_malformed = None
def is_shared_link_malformed(self):
"""
Check if the union tag is ``shared_link_malformed``.
:rtype: bool
"""
return self._tag == 'shared_link_malformed'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(RevokeSharedLinkError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'RevokeSharedLinkError(%r, %r)' % (self._tag, self._value)
RevokeSharedLinkError_validator = bv.Union(RevokeSharedLinkError)
2019-08-28 21:48:24 +02:00
class SetAccessInheritanceArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.SetAccessInheritanceArg.access_inheritance: The access
inheritance settings for the folder.
:ivar sharing.SetAccessInheritanceArg.shared_folder_id: The ID for the
shared folder.
"""
__slots__ = [
'_access_inheritance_value',
'_access_inheritance_present',
'_shared_folder_id_value',
'_shared_folder_id_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
access_inheritance=None):
self._access_inheritance_value = None
self._access_inheritance_present = False
self._shared_folder_id_value = None
self._shared_folder_id_present = False
if access_inheritance is not None:
self.access_inheritance = access_inheritance
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
@property
def access_inheritance(self):
"""
The access inheritance settings for the folder.
:rtype: AccessInheritance
"""
if self._access_inheritance_present:
return self._access_inheritance_value
else:
return AccessInheritance.inherit
@access_inheritance.setter
def access_inheritance(self, val):
self._access_inheritance_validator.validate_type_only(val)
self._access_inheritance_value = val
self._access_inheritance_present = True
@access_inheritance.deleter
def access_inheritance(self):
self._access_inheritance_value = None
self._access_inheritance_present = False
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SetAccessInheritanceArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SetAccessInheritanceArg(shared_folder_id={!r}, access_inheritance={!r})'.format(
self._shared_folder_id_value,
self._access_inheritance_value,
)
SetAccessInheritanceArg_validator = bv.Struct(SetAccessInheritanceArg)
class SetAccessInheritanceError(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 SharedFolderAccessError SetAccessInheritanceError.access_error: Unable
to access shared folder.
:ivar sharing.SetAccessInheritanceError.no_permission: The current user does
not have permission to perform this action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: SetAccessInheritanceError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Unable to access shared folder.
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SetAccessInheritanceError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SetAccessInheritanceError(%r, %r)' % (self._tag, self._value)
SetAccessInheritanceError_validator = bv.Union(SetAccessInheritanceError)
class ShareFolderArgBase(bb.Struct):
"""
:ivar sharing.ShareFolderArgBase.acl_update_policy: Who can add and remove
members of this shared folder.
:ivar sharing.ShareFolderArgBase.force_async: Whether to force the share to
happen asynchronously.
:ivar sharing.ShareFolderArgBase.member_policy: Who can be a member of this
shared folder. Only applicable if the current user is on a team.
:ivar sharing.ShareFolderArgBase.path: The path to the folder to share. If
it does not exist, then a new one is created.
:ivar sharing.ShareFolderArgBase.shared_link_policy: The policy to apply to
shared links created for content inside this shared folder. The current
user must be on a team to set this policy to
``SharedLinkPolicy.members``.
:ivar sharing.ShareFolderArgBase.viewer_info_policy: Who can enable/disable
viewer info for this shared folder.
:ivar sharing.ShareFolderArgBase.access_inheritance: The access inheritance
settings for the folder.
"""
__slots__ = [
'_acl_update_policy_value',
'_acl_update_policy_present',
'_force_async_value',
'_force_async_present',
'_member_policy_value',
'_member_policy_present',
'_path_value',
'_path_present',
'_shared_link_policy_value',
'_shared_link_policy_present',
'_viewer_info_policy_value',
'_viewer_info_policy_present',
2019-08-28 21:48:24 +02:00
'_access_inheritance_value',
'_access_inheritance_present',
]
_has_required_fields = True
def __init__(self,
path=None,
acl_update_policy=None,
force_async=None,
member_policy=None,
shared_link_policy=None,
2019-08-28 21:48:24 +02:00
viewer_info_policy=None,
access_inheritance=None):
self._acl_update_policy_value = None
self._acl_update_policy_present = False
self._force_async_value = None
self._force_async_present = False
self._member_policy_value = None
self._member_policy_present = False
self._path_value = None
self._path_present = False
self._shared_link_policy_value = None
self._shared_link_policy_present = False
self._viewer_info_policy_value = None
self._viewer_info_policy_present = False
2019-08-28 21:48:24 +02:00
self._access_inheritance_value = None
self._access_inheritance_present = False
if acl_update_policy is not None:
self.acl_update_policy = acl_update_policy
if force_async is not None:
self.force_async = force_async
if member_policy is not None:
self.member_policy = member_policy
if path is not None:
self.path = path
if shared_link_policy is not None:
self.shared_link_policy = shared_link_policy
if viewer_info_policy is not None:
self.viewer_info_policy = viewer_info_policy
2019-08-28 21:48:24 +02:00
if access_inheritance is not None:
self.access_inheritance = access_inheritance
@property
def acl_update_policy(self):
"""
Who can add and remove members of this shared folder.
:rtype: AclUpdatePolicy
"""
if self._acl_update_policy_present:
return self._acl_update_policy_value
else:
return None
@acl_update_policy.setter
def acl_update_policy(self, val):
if val is None:
del self.acl_update_policy
return
self._acl_update_policy_validator.validate_type_only(val)
self._acl_update_policy_value = val
self._acl_update_policy_present = True
@acl_update_policy.deleter
def acl_update_policy(self):
self._acl_update_policy_value = None
self._acl_update_policy_present = False
@property
def force_async(self):
"""
Whether to force the share to happen asynchronously.
:rtype: bool
"""
if self._force_async_present:
return self._force_async_value
else:
return False
@force_async.setter
def force_async(self, val):
val = self._force_async_validator.validate(val)
self._force_async_value = val
self._force_async_present = True
@force_async.deleter
def force_async(self):
self._force_async_value = None
self._force_async_present = False
@property
def member_policy(self):
"""
Who can be a member of this shared folder. Only applicable if the
current user is on a team.
:rtype: MemberPolicy
"""
if self._member_policy_present:
return self._member_policy_value
else:
return None
@member_policy.setter
def member_policy(self, val):
if val is None:
del self.member_policy
return
self._member_policy_validator.validate_type_only(val)
self._member_policy_value = val
self._member_policy_present = True
@member_policy.deleter
def member_policy(self):
self._member_policy_value = None
self._member_policy_present = False
@property
def path(self):
"""
The path to the folder to share. If it does not exist, then a new one is
created.
:rtype: str
"""
if self._path_present:
return self._path_value
else:
raise AttributeError("missing required field 'path'")
@path.setter
def path(self, val):
val = self._path_validator.validate(val)
self._path_value = val
self._path_present = True
@path.deleter
def path(self):
self._path_value = None
self._path_present = False
@property
def shared_link_policy(self):
"""
The policy to apply to shared links created for content inside this
shared folder. The current user must be on a team to set this policy to
``SharedLinkPolicy.members``.
:rtype: SharedLinkPolicy
"""
if self._shared_link_policy_present:
return self._shared_link_policy_value
else:
return None
@shared_link_policy.setter
def shared_link_policy(self, val):
if val is None:
del self.shared_link_policy
return
self._shared_link_policy_validator.validate_type_only(val)
self._shared_link_policy_value = val
self._shared_link_policy_present = True
@shared_link_policy.deleter
def shared_link_policy(self):
self._shared_link_policy_value = None
self._shared_link_policy_present = False
@property
def viewer_info_policy(self):
"""
Who can enable/disable viewer info for this shared folder.
:rtype: ViewerInfoPolicy
"""
if self._viewer_info_policy_present:
return self._viewer_info_policy_value
else:
return None
@viewer_info_policy.setter
def viewer_info_policy(self, val):
if val is None:
del self.viewer_info_policy
return
self._viewer_info_policy_validator.validate_type_only(val)
self._viewer_info_policy_value = val
self._viewer_info_policy_present = True
2019-08-28 21:48:24 +02:00
@viewer_info_policy.deleter
def viewer_info_policy(self):
self._viewer_info_policy_value = None
self._viewer_info_policy_present = False
@property
def access_inheritance(self):
"""
The access inheritance settings for the folder.
:rtype: AccessInheritance
"""
if self._access_inheritance_present:
return self._access_inheritance_value
else:
return AccessInheritance.inherit
@access_inheritance.setter
def access_inheritance(self, val):
self._access_inheritance_validator.validate_type_only(val)
self._access_inheritance_value = val
self._access_inheritance_present = True
@access_inheritance.deleter
def access_inheritance(self):
self._access_inheritance_value = None
self._access_inheritance_present = False
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ShareFolderArgBase, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
2019-08-28 21:48:24 +02:00
return 'ShareFolderArgBase(path={!r}, acl_update_policy={!r}, force_async={!r}, member_policy={!r}, shared_link_policy={!r}, viewer_info_policy={!r}, access_inheritance={!r})'.format(
self._path_value,
self._acl_update_policy_value,
self._force_async_value,
self._member_policy_value,
self._shared_link_policy_value,
self._viewer_info_policy_value,
2019-08-28 21:48:24 +02:00
self._access_inheritance_value,
)
ShareFolderArgBase_validator = bv.Struct(ShareFolderArgBase)
class ShareFolderArg(ShareFolderArgBase):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.ShareFolderArg.actions: A list of `FolderAction`s
corresponding to `FolderPermission`s that should appear in the
response's ``SharedFolderMetadata.permissions`` field describing the
actions the authenticated user can perform on the folder.
:ivar sharing.ShareFolderArg.link_settings: Settings on the link for this
folder.
"""
__slots__ = [
'_actions_value',
'_actions_present',
'_link_settings_value',
'_link_settings_present',
]
_has_required_fields = True
def __init__(self,
path=None,
acl_update_policy=None,
force_async=None,
member_policy=None,
shared_link_policy=None,
viewer_info_policy=None,
2019-08-28 21:48:24 +02:00
access_inheritance=None,
actions=None,
link_settings=None):
super(ShareFolderArg, self).__init__(path,
acl_update_policy,
force_async,
member_policy,
shared_link_policy,
2019-08-28 21:48:24 +02:00
viewer_info_policy,
access_inheritance)
self._actions_value = None
self._actions_present = False
self._link_settings_value = None
self._link_settings_present = False
if actions is not None:
self.actions = actions
if link_settings is not None:
self.link_settings = link_settings
@property
def actions(self):
"""
A list of `FolderAction`s corresponding to `FolderPermission`s that
should appear in the response's ``SharedFolderMetadata.permissions``
field describing the actions the authenticated user can perform on the
folder.
:rtype: list of [FolderAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
@property
def link_settings(self):
"""
Settings on the link for this folder.
:rtype: LinkSettings
"""
if self._link_settings_present:
return self._link_settings_value
else:
return None
@link_settings.setter
def link_settings(self, val):
if val is None:
del self.link_settings
return
self._link_settings_validator.validate_type_only(val)
self._link_settings_value = val
self._link_settings_present = True
@link_settings.deleter
def link_settings(self):
self._link_settings_value = None
self._link_settings_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ShareFolderArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
2019-08-28 21:48:24 +02:00
return 'ShareFolderArg(path={!r}, acl_update_policy={!r}, force_async={!r}, member_policy={!r}, shared_link_policy={!r}, viewer_info_policy={!r}, access_inheritance={!r}, actions={!r}, link_settings={!r})'.format(
self._path_value,
self._acl_update_policy_value,
self._force_async_value,
self._member_policy_value,
self._shared_link_policy_value,
self._viewer_info_policy_value,
2019-08-28 21:48:24 +02:00
self._access_inheritance_value,
self._actions_value,
self._link_settings_value,
)
ShareFolderArg_validator = bv.Struct(ShareFolderArg)
class ShareFolderErrorBase(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ShareFolderErrorBase.email_unverified: The current user's
e-mail address is unverified.
:ivar SharePathError ShareFolderErrorBase.bad_path: ``ShareFolderArg.path``
is invalid.
:ivar sharing.ShareFolderErrorBase.team_policy_disallows_member_policy: Team
policy is more restrictive than ``ShareFolderArg.member_policy``.
:ivar sharing.ShareFolderErrorBase.disallowed_shared_link_policy: The
current user's account is not allowed to select the specified
``ShareFolderArg.shared_link_policy``.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
email_unverified = None
# Attribute is overwritten below the class definition
team_policy_disallows_member_policy = None
# Attribute is overwritten below the class definition
disallowed_shared_link_policy = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def bad_path(cls, val):
"""
Create an instance of this class set to the ``bad_path`` tag with value
``val``.
:param SharePathError val:
:rtype: ShareFolderErrorBase
"""
return cls('bad_path', val)
def is_email_unverified(self):
"""
Check if the union tag is ``email_unverified``.
:rtype: bool
"""
return self._tag == 'email_unverified'
def is_bad_path(self):
"""
Check if the union tag is ``bad_path``.
:rtype: bool
"""
return self._tag == 'bad_path'
def is_team_policy_disallows_member_policy(self):
"""
Check if the union tag is ``team_policy_disallows_member_policy``.
:rtype: bool
"""
return self._tag == 'team_policy_disallows_member_policy'
def is_disallowed_shared_link_policy(self):
"""
Check if the union tag is ``disallowed_shared_link_policy``.
:rtype: bool
"""
return self._tag == 'disallowed_shared_link_policy'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_bad_path(self):
"""
``ShareFolderArg.path`` is invalid.
Only call this if :meth:`is_bad_path` is true.
:rtype: SharePathError
"""
if not self.is_bad_path():
raise AttributeError("tag 'bad_path' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ShareFolderErrorBase, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ShareFolderErrorBase(%r, %r)' % (self._tag, self._value)
ShareFolderErrorBase_validator = bv.Union(ShareFolderErrorBase)
class ShareFolderError(ShareFolderErrorBase):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ShareFolderError.no_permission: The current user does not have
permission to perform this action.
"""
# Attribute is overwritten below the class definition
no_permission = None
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ShareFolderError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ShareFolderError(%r, %r)' % (self._tag, self._value)
ShareFolderError_validator = bv.Union(ShareFolderError)
2019-08-28 21:48:24 +02:00
class ShareFolderJobStatus(async_.PollResultBase):
"""
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.
2019-08-28 21:48:24 +02:00
:ivar SharedFolderMetadata ShareFolderJobStatus.complete: The share job has
finished. The value is the metadata for the folder.
"""
@classmethod
def complete(cls, val):
"""
Create an instance of this class set to the ``complete`` tag with value
``val``.
:param SharedFolderMetadata val:
:rtype: ShareFolderJobStatus
"""
return cls('complete', val)
@classmethod
def failed(cls, val):
"""
Create an instance of this class set to the ``failed`` tag with value
``val``.
:param ShareFolderError val:
:rtype: ShareFolderJobStatus
"""
return cls('failed', val)
def is_complete(self):
"""
Check if the union tag is ``complete``.
:rtype: bool
"""
return self._tag == 'complete'
def is_failed(self):
"""
Check if the union tag is ``failed``.
:rtype: bool
"""
return self._tag == 'failed'
def get_complete(self):
"""
The share job has finished. The value is the metadata for the folder.
Only call this if :meth:`is_complete` is true.
:rtype: SharedFolderMetadata
"""
if not self.is_complete():
raise AttributeError("tag 'complete' not set")
return self._value
def get_failed(self):
"""
Only call this if :meth:`is_failed` is true.
:rtype: ShareFolderError
"""
if not self.is_failed():
raise AttributeError("tag 'failed' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ShareFolderJobStatus, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ShareFolderJobStatus(%r, %r)' % (self._tag, self._value)
ShareFolderJobStatus_validator = bv.Union(ShareFolderJobStatus)
2019-08-28 21:48:24 +02:00
class ShareFolderLaunch(async_.LaunchResultBase):
"""
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.
"""
@classmethod
def complete(cls, val):
"""
Create an instance of this class set to the ``complete`` tag with value
``val``.
:param SharedFolderMetadata val:
:rtype: ShareFolderLaunch
"""
return cls('complete', val)
def is_complete(self):
"""
Check if the union tag is ``complete``.
:rtype: bool
"""
return self._tag == 'complete'
def get_complete(self):
"""
Only call this if :meth:`is_complete` is true.
:rtype: SharedFolderMetadata
"""
if not self.is_complete():
raise AttributeError("tag 'complete' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ShareFolderLaunch, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ShareFolderLaunch(%r, %r)' % (self._tag, self._value)
ShareFolderLaunch_validator = bv.Union(ShareFolderLaunch)
class SharePathError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharePathError.is_file: A file is at the specified path.
:ivar sharing.SharePathError.inside_shared_folder: We do not support sharing
a folder inside a shared folder.
:ivar sharing.SharePathError.contains_shared_folder: We do not support
shared folders that contain shared folders.
:ivar sharing.SharePathError.contains_app_folder: We do not support shared
folders that contain app folders.
:ivar sharing.SharePathError.contains_team_folder: We do not support shared
folders that contain team folders.
:ivar sharing.SharePathError.is_app_folder: We do not support sharing an app
folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharePathError.inside_app_folder: We do not support sharing a
folder inside an app folder.
:ivar sharing.SharePathError.is_public_folder: A public folder can't be
shared this way. Use a public link instead.
:ivar sharing.SharePathError.inside_public_folder: A folder inside a public
folder can't be shared this way. Use a public link instead.
:ivar SharedFolderMetadata SharePathError.already_shared: Folder is already
shared. Contains metadata about the existing shared folder.
:ivar sharing.SharePathError.invalid_path: Path is not valid.
:ivar sharing.SharePathError.is_osx_package: We do not support sharing a Mac
OS X package.
:ivar sharing.SharePathError.inside_osx_package: We do not support sharing a
folder inside a Mac OS X package.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
is_file = None
# Attribute is overwritten below the class definition
inside_shared_folder = None
# Attribute is overwritten below the class definition
contains_shared_folder = None
# Attribute is overwritten below the class definition
contains_app_folder = None
# Attribute is overwritten below the class definition
contains_team_folder = None
# Attribute is overwritten below the class definition
is_app_folder = None
# Attribute is overwritten below the class definition
inside_app_folder = None
# Attribute is overwritten below the class definition
is_public_folder = None
# Attribute is overwritten below the class definition
inside_public_folder = None
# Attribute is overwritten below the class definition
invalid_path = None
# Attribute is overwritten below the class definition
is_osx_package = None
# Attribute is overwritten below the class definition
inside_osx_package = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def already_shared(cls, val):
"""
Create an instance of this class set to the ``already_shared`` tag with
value ``val``.
:param SharedFolderMetadata val:
:rtype: SharePathError
"""
return cls('already_shared', val)
def is_is_file(self):
"""
Check if the union tag is ``is_file``.
:rtype: bool
"""
return self._tag == 'is_file'
def is_inside_shared_folder(self):
"""
Check if the union tag is ``inside_shared_folder``.
:rtype: bool
"""
return self._tag == 'inside_shared_folder'
def is_contains_shared_folder(self):
"""
Check if the union tag is ``contains_shared_folder``.
:rtype: bool
"""
return self._tag == 'contains_shared_folder'
def is_contains_app_folder(self):
"""
Check if the union tag is ``contains_app_folder``.
:rtype: bool
"""
return self._tag == 'contains_app_folder'
def is_contains_team_folder(self):
"""
Check if the union tag is ``contains_team_folder``.
:rtype: bool
"""
return self._tag == 'contains_team_folder'
def is_is_app_folder(self):
"""
Check if the union tag is ``is_app_folder``.
:rtype: bool
"""
return self._tag == 'is_app_folder'
def is_inside_app_folder(self):
"""
Check if the union tag is ``inside_app_folder``.
:rtype: bool
"""
return self._tag == 'inside_app_folder'
def is_is_public_folder(self):
"""
Check if the union tag is ``is_public_folder``.
:rtype: bool
"""
return self._tag == 'is_public_folder'
def is_inside_public_folder(self):
"""
Check if the union tag is ``inside_public_folder``.
:rtype: bool
"""
return self._tag == 'inside_public_folder'
def is_already_shared(self):
"""
Check if the union tag is ``already_shared``.
:rtype: bool
"""
return self._tag == 'already_shared'
def is_invalid_path(self):
"""
Check if the union tag is ``invalid_path``.
:rtype: bool
"""
return self._tag == 'invalid_path'
def is_is_osx_package(self):
"""
Check if the union tag is ``is_osx_package``.
:rtype: bool
"""
return self._tag == 'is_osx_package'
def is_inside_osx_package(self):
"""
Check if the union tag is ``inside_osx_package``.
:rtype: bool
"""
return self._tag == 'inside_osx_package'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_already_shared(self):
"""
Folder is already shared. Contains metadata about the existing shared
folder.
Only call this if :meth:`is_already_shared` is true.
:rtype: SharedFolderMetadata
"""
if not self.is_already_shared():
raise AttributeError("tag 'already_shared' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharePathError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharePathError(%r, %r)' % (self._tag, self._value)
SharePathError_validator = bv.Union(SharePathError)
class SharedContentLinkMetadata(SharedContentLinkMetadataBase):
"""
Metadata of a shared link for a file or folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedContentLinkMetadata.audience_exceptions: The content
inside this folder with link audience different than this folder's. This
is only returned when an endpoint that returns metadata for a single
shared folder is called, e.g. /get_folder_metadata.
:ivar sharing.SharedContentLinkMetadata.url: The URL of the link.
"""
__slots__ = [
'_audience_exceptions_value',
'_audience_exceptions_present',
'_url_value',
'_url_present',
]
_has_required_fields = True
def __init__(self,
audience_options=None,
current_audience=None,
link_permissions=None,
password_protected=None,
url=None,
access_level=None,
audience_restricting_shared_folder=None,
expiry=None,
audience_exceptions=None):
super(SharedContentLinkMetadata, self).__init__(audience_options,
current_audience,
link_permissions,
password_protected,
access_level,
audience_restricting_shared_folder,
expiry)
self._audience_exceptions_value = None
self._audience_exceptions_present = False
self._url_value = None
self._url_present = False
if audience_exceptions is not None:
self.audience_exceptions = audience_exceptions
if url is not None:
self.url = url
@property
def audience_exceptions(self):
"""
The content inside this folder with link audience different than this
folder's. This is only returned when an endpoint that returns metadata
for a single shared folder is called, e.g. /get_folder_metadata.
:rtype: AudienceExceptions
"""
if self._audience_exceptions_present:
return self._audience_exceptions_value
else:
return None
@audience_exceptions.setter
def audience_exceptions(self, val):
if val is None:
del self.audience_exceptions
return
self._audience_exceptions_validator.validate_type_only(val)
self._audience_exceptions_value = val
self._audience_exceptions_present = True
@audience_exceptions.deleter
def audience_exceptions(self):
self._audience_exceptions_value = None
self._audience_exceptions_present = False
@property
def url(self):
"""
The URL of the link.
:rtype: str
"""
if self._url_present:
return self._url_value
else:
raise AttributeError("missing required field 'url'")
@url.setter
def url(self, val):
val = self._url_validator.validate(val)
self._url_value = val
self._url_present = True
@url.deleter
def url(self):
self._url_value = None
self._url_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedContentLinkMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedContentLinkMetadata(audience_options={!r}, current_audience={!r}, link_permissions={!r}, password_protected={!r}, url={!r}, access_level={!r}, audience_restricting_shared_folder={!r}, expiry={!r}, audience_exceptions={!r})'.format(
self._audience_options_value,
self._current_audience_value,
self._link_permissions_value,
self._password_protected_value,
self._url_value,
self._access_level_value,
self._audience_restricting_shared_folder_value,
self._expiry_value,
self._audience_exceptions_value,
)
SharedContentLinkMetadata_validator = bv.Struct(SharedContentLinkMetadata)
2019-08-28 21:48:24 +02:00
class SharedFileMembers(bb.Struct):
"""
Shared file user, group, and invitee membership. Used for the results of
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members` and
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue`, and used
as part of the results for
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_batch`.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFileMembers.users: The list of user members of the
shared file.
:ivar sharing.SharedFileMembers.groups: The list of group members of the
shared file.
:ivar sharing.SharedFileMembers.invitees: The list of invited members of a
file, but have not logged in and claimed this.
:ivar sharing.SharedFileMembers.cursor: Present if there are additional
shared file members that have not been returned yet. Pass the cursor
into :meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue`
to list additional members.
"""
__slots__ = [
'_users_value',
'_users_present',
'_groups_value',
'_groups_present',
'_invitees_value',
'_invitees_present',
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
users=None,
groups=None,
invitees=None,
cursor=None):
self._users_value = None
self._users_present = False
self._groups_value = None
self._groups_present = False
self._invitees_value = None
self._invitees_present = False
self._cursor_value = None
self._cursor_present = False
if users is not None:
self.users = users
if groups is not None:
self.groups = groups
if invitees is not None:
self.invitees = invitees
if cursor is not None:
self.cursor = cursor
@property
def users(self):
"""
The list of user members of the shared file.
:rtype: list of [UserFileMembershipInfo]
"""
if self._users_present:
return self._users_value
else:
raise AttributeError("missing required field 'users'")
@users.setter
def users(self, val):
val = self._users_validator.validate(val)
self._users_value = val
self._users_present = True
@users.deleter
def users(self):
self._users_value = None
self._users_present = False
@property
def groups(self):
"""
The list of group members of the shared file.
:rtype: list of [GroupMembershipInfo]
"""
if self._groups_present:
return self._groups_value
else:
raise AttributeError("missing required field 'groups'")
@groups.setter
def groups(self, val):
val = self._groups_validator.validate(val)
self._groups_value = val
self._groups_present = True
@groups.deleter
def groups(self):
self._groups_value = None
self._groups_present = False
@property
def invitees(self):
"""
The list of invited members of a file, but have not logged in and
claimed this.
:rtype: list of [InviteeMembershipInfo]
"""
if self._invitees_present:
return self._invitees_value
else:
raise AttributeError("missing required field 'invitees'")
@invitees.setter
def invitees(self, val):
val = self._invitees_validator.validate(val)
self._invitees_value = val
self._invitees_present = True
@invitees.deleter
def invitees(self):
self._invitees_value = None
self._invitees_present = False
@property
def cursor(self):
"""
Present if there are additional shared file members that have not been
returned yet. Pass the cursor into
:meth:`dropbox.dropbox.Dropbox.sharing_list_file_members_continue` to
list additional members.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
return None
@cursor.setter
def cursor(self, val):
if val is None:
del self.cursor
return
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFileMembers, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedFileMembers(users={!r}, groups={!r}, invitees={!r}, cursor={!r})'.format(
self._users_value,
self._groups_value,
self._invitees_value,
self._cursor_value,
)
SharedFileMembers_validator = bv.Struct(SharedFileMembers)
2019-08-28 21:48:24 +02:00
class SharedFileMetadata(bb.Struct):
"""
Properties of the shared file.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFileMetadata.access_type: The current user's access
level for this shared file.
:ivar sharing.SharedFileMetadata.id: The ID of the file.
:ivar sharing.SharedFileMetadata.expected_link_metadata: The expected
metadata of the link associated for the file when it is first shared.
Absent if the link already exists. This is for an unreleased feature so
it may not be returned yet.
:ivar sharing.SharedFileMetadata.link_metadata: The metadata of the link
associated for the file. This is for an unreleased feature so it may not
be returned yet.
:ivar sharing.SharedFileMetadata.name: The name of this file.
:ivar sharing.SharedFileMetadata.owner_display_names: The display names of
the users that own the file. If the file is part of a team folder, the
display names of the team admins are also included. Absent if the owner
display names cannot be fetched.
:ivar sharing.SharedFileMetadata.owner_team: The team that owns the file.
This field is not present if the file is not owned by a team.
:ivar sharing.SharedFileMetadata.parent_shared_folder_id: The ID of the
parent shared folder. This field is present only if the file is
contained within a shared folder.
:ivar sharing.SharedFileMetadata.path_display: The cased path to be used for
display purposes only. In rare instances the casing will not correctly
match the user's filesystem, but this behavior will match the path
provided in the Core API v1. Absent for unmounted files.
:ivar sharing.SharedFileMetadata.path_lower: The lower-case full path of
this file. Absent for unmounted files.
:ivar sharing.SharedFileMetadata.permissions: The sharing permissions that
requesting user has on this file. This corresponds to the entries given
in ``GetFileMetadataBatchArg.actions`` or
``GetFileMetadataArg.actions``.
:ivar sharing.SharedFileMetadata.policy: Policies governing this shared
file.
:ivar sharing.SharedFileMetadata.preview_url: URL for displaying a web
preview of the shared file.
:ivar sharing.SharedFileMetadata.time_invited: Timestamp indicating when the
current user was invited to this shared file. If the user was not
invited to the shared file, the timestamp will indicate when the user
was invited to the parent shared folder. This value may be absent.
"""
__slots__ = [
'_access_type_value',
'_access_type_present',
'_id_value',
'_id_present',
'_expected_link_metadata_value',
'_expected_link_metadata_present',
'_link_metadata_value',
'_link_metadata_present',
'_name_value',
'_name_present',
'_owner_display_names_value',
'_owner_display_names_present',
'_owner_team_value',
'_owner_team_present',
'_parent_shared_folder_id_value',
'_parent_shared_folder_id_present',
'_path_display_value',
'_path_display_present',
'_path_lower_value',
'_path_lower_present',
'_permissions_value',
'_permissions_present',
'_policy_value',
'_policy_present',
'_preview_url_value',
'_preview_url_present',
'_time_invited_value',
'_time_invited_present',
]
_has_required_fields = True
def __init__(self,
id=None,
name=None,
policy=None,
preview_url=None,
access_type=None,
expected_link_metadata=None,
link_metadata=None,
owner_display_names=None,
owner_team=None,
parent_shared_folder_id=None,
path_display=None,
path_lower=None,
permissions=None,
time_invited=None):
self._access_type_value = None
self._access_type_present = False
self._id_value = None
self._id_present = False
self._expected_link_metadata_value = None
self._expected_link_metadata_present = False
self._link_metadata_value = None
self._link_metadata_present = False
self._name_value = None
self._name_present = False
self._owner_display_names_value = None
self._owner_display_names_present = False
self._owner_team_value = None
self._owner_team_present = False
self._parent_shared_folder_id_value = None
self._parent_shared_folder_id_present = False
self._path_display_value = None
self._path_display_present = False
self._path_lower_value = None
self._path_lower_present = False
self._permissions_value = None
self._permissions_present = False
self._policy_value = None
self._policy_present = False
self._preview_url_value = None
self._preview_url_present = False
self._time_invited_value = None
self._time_invited_present = False
if access_type is not None:
self.access_type = access_type
if id is not None:
self.id = id
if expected_link_metadata is not None:
self.expected_link_metadata = expected_link_metadata
if link_metadata is not None:
self.link_metadata = link_metadata
if name is not None:
self.name = name
if owner_display_names is not None:
self.owner_display_names = owner_display_names
if owner_team is not None:
self.owner_team = owner_team
if parent_shared_folder_id is not None:
self.parent_shared_folder_id = parent_shared_folder_id
if path_display is not None:
self.path_display = path_display
if path_lower is not None:
self.path_lower = path_lower
if permissions is not None:
self.permissions = permissions
if policy is not None:
self.policy = policy
if preview_url is not None:
self.preview_url = preview_url
if time_invited is not None:
self.time_invited = time_invited
@property
def access_type(self):
"""
The current user's access level for this shared file.
:rtype: AccessLevel
"""
if self._access_type_present:
return self._access_type_value
else:
return None
@access_type.setter
def access_type(self, val):
if val is None:
del self.access_type
return
self._access_type_validator.validate_type_only(val)
self._access_type_value = val
self._access_type_present = True
@access_type.deleter
def access_type(self):
self._access_type_value = None
self._access_type_present = False
@property
def id(self):
"""
The ID of the file.
:rtype: str
"""
if self._id_present:
return self._id_value
else:
raise AttributeError("missing required field 'id'")
@id.setter
def id(self, val):
val = self._id_validator.validate(val)
self._id_value = val
self._id_present = True
@id.deleter
def id(self):
self._id_value = None
self._id_present = False
@property
def expected_link_metadata(self):
"""
The expected metadata of the link associated for the file when it is
first shared. Absent if the link already exists. This is for an
unreleased feature so it may not be returned yet.
:rtype: ExpectedSharedContentLinkMetadata
"""
if self._expected_link_metadata_present:
return self._expected_link_metadata_value
else:
return None
@expected_link_metadata.setter
def expected_link_metadata(self, val):
if val is None:
del self.expected_link_metadata
return
self._expected_link_metadata_validator.validate_type_only(val)
self._expected_link_metadata_value = val
self._expected_link_metadata_present = True
@expected_link_metadata.deleter
def expected_link_metadata(self):
self._expected_link_metadata_value = None
self._expected_link_metadata_present = False
@property
def link_metadata(self):
"""
The metadata of the link associated for the file. This is for an
unreleased feature so it may not be returned yet.
:rtype: SharedContentLinkMetadata
"""
if self._link_metadata_present:
return self._link_metadata_value
else:
return None
@link_metadata.setter
def link_metadata(self, val):
if val is None:
del self.link_metadata
return
self._link_metadata_validator.validate_type_only(val)
self._link_metadata_value = val
self._link_metadata_present = True
@link_metadata.deleter
def link_metadata(self):
self._link_metadata_value = None
self._link_metadata_present = False
@property
def name(self):
"""
The name of this file.
:rtype: str
"""
if self._name_present:
return self._name_value
else:
raise AttributeError("missing required field 'name'")
@name.setter
def name(self, val):
val = self._name_validator.validate(val)
self._name_value = val
self._name_present = True
@name.deleter
def name(self):
self._name_value = None
self._name_present = False
@property
def owner_display_names(self):
"""
The display names of the users that own the file. If the file is part of
a team folder, the display names of the team admins are also included.
Absent if the owner display names cannot be fetched.
:rtype: list of [str]
"""
if self._owner_display_names_present:
return self._owner_display_names_value
else:
return None
@owner_display_names.setter
def owner_display_names(self, val):
if val is None:
del self.owner_display_names
return
val = self._owner_display_names_validator.validate(val)
self._owner_display_names_value = val
self._owner_display_names_present = True
@owner_display_names.deleter
def owner_display_names(self):
self._owner_display_names_value = None
self._owner_display_names_present = False
@property
def owner_team(self):
"""
The team that owns the file. This field is not present if the file is
not owned by a team.
2019-08-28 21:48:24 +02:00
:rtype: users.Team
"""
if self._owner_team_present:
return self._owner_team_value
else:
return None
@owner_team.setter
def owner_team(self, val):
if val is None:
del self.owner_team
return
self._owner_team_validator.validate_type_only(val)
self._owner_team_value = val
self._owner_team_present = True
@owner_team.deleter
def owner_team(self):
self._owner_team_value = None
self._owner_team_present = False
@property
def parent_shared_folder_id(self):
"""
The ID of the parent shared folder. This field is present only if the
file is contained within a shared folder.
:rtype: str
"""
if self._parent_shared_folder_id_present:
return self._parent_shared_folder_id_value
else:
return None
@parent_shared_folder_id.setter
def parent_shared_folder_id(self, val):
if val is None:
del self.parent_shared_folder_id
return
val = self._parent_shared_folder_id_validator.validate(val)
self._parent_shared_folder_id_value = val
self._parent_shared_folder_id_present = True
@parent_shared_folder_id.deleter
def parent_shared_folder_id(self):
self._parent_shared_folder_id_value = None
self._parent_shared_folder_id_present = False
@property
def path_display(self):
"""
The cased path to be used for display purposes only. In rare instances
the casing will not correctly match the user's filesystem, but this
behavior will match the path provided in the Core API v1. Absent for
unmounted files.
:rtype: str
"""
if self._path_display_present:
return self._path_display_value
else:
return None
@path_display.setter
def path_display(self, val):
if val is None:
del self.path_display
return
val = self._path_display_validator.validate(val)
self._path_display_value = val
self._path_display_present = True
@path_display.deleter
def path_display(self):
self._path_display_value = None
self._path_display_present = False
@property
def path_lower(self):
"""
The lower-case full path of this file. Absent for unmounted files.
:rtype: str
"""
if self._path_lower_present:
return self._path_lower_value
else:
return None
@path_lower.setter
def path_lower(self, val):
if val is None:
del self.path_lower
return
val = self._path_lower_validator.validate(val)
self._path_lower_value = val
self._path_lower_present = True
@path_lower.deleter
def path_lower(self):
self._path_lower_value = None
self._path_lower_present = False
@property
def permissions(self):
"""
The sharing permissions that requesting user has on this file. This
corresponds to the entries given in ``GetFileMetadataBatchArg.actions``
or ``GetFileMetadataArg.actions``.
:rtype: list of [FilePermission]
"""
if self._permissions_present:
return self._permissions_value
else:
return None
@permissions.setter
def permissions(self, val):
if val is None:
del self.permissions
return
val = self._permissions_validator.validate(val)
self._permissions_value = val
self._permissions_present = True
@permissions.deleter
def permissions(self):
self._permissions_value = None
self._permissions_present = False
@property
def policy(self):
"""
Policies governing this shared file.
:rtype: FolderPolicy
"""
if self._policy_present:
return self._policy_value
else:
raise AttributeError("missing required field 'policy'")
@policy.setter
def policy(self, val):
self._policy_validator.validate_type_only(val)
self._policy_value = val
self._policy_present = True
@policy.deleter
def policy(self):
self._policy_value = None
self._policy_present = False
@property
def preview_url(self):
"""
URL for displaying a web preview of the shared file.
:rtype: str
"""
if self._preview_url_present:
return self._preview_url_value
else:
raise AttributeError("missing required field 'preview_url'")
@preview_url.setter
def preview_url(self, val):
val = self._preview_url_validator.validate(val)
self._preview_url_value = val
self._preview_url_present = True
@preview_url.deleter
def preview_url(self):
self._preview_url_value = None
self._preview_url_present = False
@property
def time_invited(self):
"""
Timestamp indicating when the current user was invited to this shared
file. If the user was not invited to the shared file, the timestamp will
indicate when the user was invited to the parent shared folder. This
value may be absent.
:rtype: datetime.datetime
"""
if self._time_invited_present:
return self._time_invited_value
else:
return None
@time_invited.setter
def time_invited(self, val):
if val is None:
del self.time_invited
return
val = self._time_invited_validator.validate(val)
self._time_invited_value = val
self._time_invited_present = True
@time_invited.deleter
def time_invited(self):
self._time_invited_value = None
self._time_invited_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFileMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedFileMetadata(id={!r}, name={!r}, policy={!r}, preview_url={!r}, access_type={!r}, expected_link_metadata={!r}, link_metadata={!r}, owner_display_names={!r}, owner_team={!r}, parent_shared_folder_id={!r}, path_display={!r}, path_lower={!r}, permissions={!r}, time_invited={!r})'.format(
self._id_value,
self._name_value,
self._policy_value,
self._preview_url_value,
self._access_type_value,
self._expected_link_metadata_value,
self._link_metadata_value,
self._owner_display_names_value,
self._owner_team_value,
self._parent_shared_folder_id_value,
self._path_display_value,
self._path_lower_value,
self._permissions_value,
self._time_invited_value,
)
SharedFileMetadata_validator = bv.Struct(SharedFileMetadata)
class SharedFolderAccessError(bb.Union):
"""
There is an error accessing the shared folder.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFolderAccessError.invalid_id: This shared folder ID is
invalid.
:ivar sharing.SharedFolderAccessError.not_a_member: The user is not a member
of the shared folder thus cannot access it.
:ivar sharing.SharedFolderAccessError.email_unverified: Never set.
:ivar sharing.SharedFolderAccessError.unmounted: The shared folder is
unmounted.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_id = None
# Attribute is overwritten below the class definition
not_a_member = None
# Attribute is overwritten below the class definition
email_unverified = None
# Attribute is overwritten below the class definition
unmounted = None
# Attribute is overwritten below the class definition
other = None
def is_invalid_id(self):
"""
Check if the union tag is ``invalid_id``.
:rtype: bool
"""
return self._tag == 'invalid_id'
def is_not_a_member(self):
"""
Check if the union tag is ``not_a_member``.
:rtype: bool
"""
return self._tag == 'not_a_member'
def is_email_unverified(self):
"""
Check if the union tag is ``email_unverified``.
:rtype: bool
"""
return self._tag == 'email_unverified'
def is_unmounted(self):
"""
Check if the union tag is ``unmounted``.
:rtype: bool
"""
return self._tag == 'unmounted'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFolderAccessError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedFolderAccessError(%r, %r)' % (self._tag, self._value)
SharedFolderAccessError_validator = bv.Union(SharedFolderAccessError)
class SharedFolderMemberError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFolderMemberError.invalid_dropbox_id: The target
dropbox_id is invalid.
:ivar sharing.SharedFolderMemberError.not_a_member: The target dropbox_id is
not a member of the shared folder.
:ivar MemberAccessLevelResult SharedFolderMemberError.no_explicit_access:
The target member only has inherited access to the shared folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_dropbox_id = None
# Attribute is overwritten below the class definition
not_a_member = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def no_explicit_access(cls, val):
"""
Create an instance of this class set to the ``no_explicit_access`` tag
with value ``val``.
:param MemberAccessLevelResult val:
:rtype: SharedFolderMemberError
"""
return cls('no_explicit_access', val)
def is_invalid_dropbox_id(self):
"""
Check if the union tag is ``invalid_dropbox_id``.
:rtype: bool
"""
return self._tag == 'invalid_dropbox_id'
def is_not_a_member(self):
"""
Check if the union tag is ``not_a_member``.
:rtype: bool
"""
return self._tag == 'not_a_member'
def is_no_explicit_access(self):
"""
Check if the union tag is ``no_explicit_access``.
:rtype: bool
"""
return self._tag == 'no_explicit_access'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_no_explicit_access(self):
"""
The target member only has inherited access to the shared folder.
Only call this if :meth:`is_no_explicit_access` is true.
:rtype: MemberAccessLevelResult
"""
if not self.is_no_explicit_access():
raise AttributeError("tag 'no_explicit_access' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFolderMemberError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedFolderMemberError(%r, %r)' % (self._tag, self._value)
SharedFolderMemberError_validator = bv.Union(SharedFolderMemberError)
2019-08-28 21:48:24 +02:00
class SharedFolderMembers(bb.Struct):
"""
Shared folder user and group membership.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFolderMembers.users: The list of user members of the
shared folder.
:ivar sharing.SharedFolderMembers.groups: The list of group members of the
shared folder.
:ivar sharing.SharedFolderMembers.invitees: The list of invitees to the
shared folder.
:ivar sharing.SharedFolderMembers.cursor: Present if there are additional
shared folder members that have not been returned yet. Pass the cursor
into
:meth:`dropbox.dropbox.Dropbox.sharing_list_folder_members_continue` to
list additional members.
"""
__slots__ = [
'_users_value',
'_users_present',
'_groups_value',
'_groups_present',
'_invitees_value',
'_invitees_present',
'_cursor_value',
'_cursor_present',
]
_has_required_fields = True
def __init__(self,
users=None,
groups=None,
invitees=None,
cursor=None):
self._users_value = None
self._users_present = False
self._groups_value = None
self._groups_present = False
self._invitees_value = None
self._invitees_present = False
self._cursor_value = None
self._cursor_present = False
if users is not None:
self.users = users
if groups is not None:
self.groups = groups
if invitees is not None:
self.invitees = invitees
if cursor is not None:
self.cursor = cursor
@property
def users(self):
"""
The list of user members of the shared folder.
:rtype: list of [UserMembershipInfo]
"""
if self._users_present:
return self._users_value
else:
raise AttributeError("missing required field 'users'")
@users.setter
def users(self, val):
val = self._users_validator.validate(val)
self._users_value = val
self._users_present = True
@users.deleter
def users(self):
self._users_value = None
self._users_present = False
@property
def groups(self):
"""
The list of group members of the shared folder.
:rtype: list of [GroupMembershipInfo]
"""
if self._groups_present:
return self._groups_value
else:
raise AttributeError("missing required field 'groups'")
@groups.setter
def groups(self, val):
val = self._groups_validator.validate(val)
self._groups_value = val
self._groups_present = True
@groups.deleter
def groups(self):
self._groups_value = None
self._groups_present = False
@property
def invitees(self):
"""
The list of invitees to the shared folder.
:rtype: list of [InviteeMembershipInfo]
"""
if self._invitees_present:
return self._invitees_value
else:
raise AttributeError("missing required field 'invitees'")
@invitees.setter
def invitees(self, val):
val = self._invitees_validator.validate(val)
self._invitees_value = val
self._invitees_present = True
@invitees.deleter
def invitees(self):
self._invitees_value = None
self._invitees_present = False
@property
def cursor(self):
"""
Present if there are additional shared folder members that have not been
returned yet. Pass the cursor into
:meth:`dropbox.dropbox.Dropbox.sharing_list_folder_members_continue` to
list additional members.
:rtype: str
"""
if self._cursor_present:
return self._cursor_value
else:
return None
@cursor.setter
def cursor(self, val):
if val is None:
del self.cursor
return
val = self._cursor_validator.validate(val)
self._cursor_value = val
self._cursor_present = True
@cursor.deleter
def cursor(self):
self._cursor_value = None
self._cursor_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFolderMembers, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedFolderMembers(users={!r}, groups={!r}, invitees={!r}, cursor={!r})'.format(
self._users_value,
self._groups_value,
self._invitees_value,
self._cursor_value,
)
SharedFolderMembers_validator = bv.Struct(SharedFolderMembers)
2019-08-28 21:48:24 +02:00
class SharedFolderMetadataBase(bb.Struct):
"""
Properties of the shared folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFolderMetadataBase.access_type: The current user's
access level for this shared folder.
:ivar sharing.SharedFolderMetadataBase.is_inside_team_folder: Whether this
folder is inside of a team folder.
:ivar sharing.SharedFolderMetadataBase.is_team_folder: Whether this folder
is a `team folder <https://www.dropbox.com/en/help/986>`_.
:ivar sharing.SharedFolderMetadataBase.owner_display_names: The display
names of the users that own the folder. If the folder is part of a team
folder, the display names of the team admins are also included. Absent
if the owner display names cannot be fetched.
:ivar sharing.SharedFolderMetadataBase.owner_team: The team that owns the
folder. This field is not present if the folder is not owned by a team.
:ivar sharing.SharedFolderMetadataBase.parent_shared_folder_id: The ID of
the parent shared folder. This field is present only if the folder is
contained within another shared folder.
:ivar sharing.SharedFolderMetadataBase.path_lower: The lower-cased full path
of this shared folder. Absent for unmounted folders.
"""
__slots__ = [
'_access_type_value',
'_access_type_present',
'_is_inside_team_folder_value',
'_is_inside_team_folder_present',
'_is_team_folder_value',
'_is_team_folder_present',
'_owner_display_names_value',
'_owner_display_names_present',
'_owner_team_value',
'_owner_team_present',
'_parent_shared_folder_id_value',
'_parent_shared_folder_id_present',
'_path_lower_value',
'_path_lower_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
is_inside_team_folder=None,
is_team_folder=None,
owner_display_names=None,
owner_team=None,
parent_shared_folder_id=None,
path_lower=None):
self._access_type_value = None
self._access_type_present = False
self._is_inside_team_folder_value = None
self._is_inside_team_folder_present = False
self._is_team_folder_value = None
self._is_team_folder_present = False
self._owner_display_names_value = None
self._owner_display_names_present = False
self._owner_team_value = None
self._owner_team_present = False
self._parent_shared_folder_id_value = None
self._parent_shared_folder_id_present = False
self._path_lower_value = None
self._path_lower_present = False
if access_type is not None:
self.access_type = access_type
if is_inside_team_folder is not None:
self.is_inside_team_folder = is_inside_team_folder
if is_team_folder is not None:
self.is_team_folder = is_team_folder
if owner_display_names is not None:
self.owner_display_names = owner_display_names
if owner_team is not None:
self.owner_team = owner_team
if parent_shared_folder_id is not None:
self.parent_shared_folder_id = parent_shared_folder_id
if path_lower is not None:
self.path_lower = path_lower
@property
def access_type(self):
"""
The current user's access level for this shared folder.
:rtype: AccessLevel
"""
if self._access_type_present:
return self._access_type_value
else:
raise AttributeError("missing required field 'access_type'")
@access_type.setter
def access_type(self, val):
self._access_type_validator.validate_type_only(val)
self._access_type_value = val
self._access_type_present = True
@access_type.deleter
def access_type(self):
self._access_type_value = None
self._access_type_present = False
@property
def is_inside_team_folder(self):
"""
Whether this folder is inside of a team folder.
:rtype: bool
"""
if self._is_inside_team_folder_present:
return self._is_inside_team_folder_value
else:
raise AttributeError("missing required field 'is_inside_team_folder'")
@is_inside_team_folder.setter
def is_inside_team_folder(self, val):
val = self._is_inside_team_folder_validator.validate(val)
self._is_inside_team_folder_value = val
self._is_inside_team_folder_present = True
@is_inside_team_folder.deleter
def is_inside_team_folder(self):
self._is_inside_team_folder_value = None
self._is_inside_team_folder_present = False
@property
def is_team_folder(self):
"""
Whether this folder is a `team folder
<https://www.dropbox.com/en/help/986>`_.
:rtype: bool
"""
if self._is_team_folder_present:
return self._is_team_folder_value
else:
raise AttributeError("missing required field 'is_team_folder'")
@is_team_folder.setter
def is_team_folder(self, val):
val = self._is_team_folder_validator.validate(val)
self._is_team_folder_value = val
self._is_team_folder_present = True
@is_team_folder.deleter
def is_team_folder(self):
self._is_team_folder_value = None
self._is_team_folder_present = False
@property
def owner_display_names(self):
"""
The display names of the users that own the folder. If the folder is
part of a team folder, the display names of the team admins are also
included. Absent if the owner display names cannot be fetched.
:rtype: list of [str]
"""
if self._owner_display_names_present:
return self._owner_display_names_value
else:
return None
@owner_display_names.setter
def owner_display_names(self, val):
if val is None:
del self.owner_display_names
return
val = self._owner_display_names_validator.validate(val)
self._owner_display_names_value = val
self._owner_display_names_present = True
@owner_display_names.deleter
def owner_display_names(self):
self._owner_display_names_value = None
self._owner_display_names_present = False
@property
def owner_team(self):
"""
The team that owns the folder. This field is not present if the folder
is not owned by a team.
2019-08-28 21:48:24 +02:00
:rtype: users.Team
"""
if self._owner_team_present:
return self._owner_team_value
else:
return None
@owner_team.setter
def owner_team(self, val):
if val is None:
del self.owner_team
return
self._owner_team_validator.validate_type_only(val)
self._owner_team_value = val
self._owner_team_present = True
@owner_team.deleter
def owner_team(self):
self._owner_team_value = None
self._owner_team_present = False
@property
def parent_shared_folder_id(self):
"""
The ID of the parent shared folder. This field is present only if the
folder is contained within another shared folder.
:rtype: str
"""
if self._parent_shared_folder_id_present:
return self._parent_shared_folder_id_value
else:
return None
@parent_shared_folder_id.setter
def parent_shared_folder_id(self, val):
if val is None:
del self.parent_shared_folder_id
return
val = self._parent_shared_folder_id_validator.validate(val)
self._parent_shared_folder_id_value = val
self._parent_shared_folder_id_present = True
@parent_shared_folder_id.deleter
def parent_shared_folder_id(self):
self._parent_shared_folder_id_value = None
self._parent_shared_folder_id_present = False
@property
def path_lower(self):
"""
The lower-cased full path of this shared folder. Absent for unmounted
folders.
:rtype: str
"""
if self._path_lower_present:
return self._path_lower_value
else:
return None
@path_lower.setter
def path_lower(self, val):
if val is None:
del self.path_lower
return
val = self._path_lower_validator.validate(val)
self._path_lower_value = val
self._path_lower_present = True
@path_lower.deleter
def path_lower(self):
self._path_lower_value = None
self._path_lower_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFolderMetadataBase, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedFolderMetadataBase(access_type={!r}, is_inside_team_folder={!r}, is_team_folder={!r}, owner_display_names={!r}, owner_team={!r}, parent_shared_folder_id={!r}, path_lower={!r})'.format(
self._access_type_value,
self._is_inside_team_folder_value,
self._is_team_folder_value,
self._owner_display_names_value,
self._owner_team_value,
self._parent_shared_folder_id_value,
self._path_lower_value,
)
SharedFolderMetadataBase_validator = bv.Struct(SharedFolderMetadataBase)
class SharedFolderMetadata(SharedFolderMetadataBase):
"""
The metadata which includes basic information about the shared folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedFolderMetadata.link_metadata: The metadata of the shared
content link to this shared folder. Absent if there is no link on the
folder. This is for an unreleased feature so it may not be returned yet.
:ivar sharing.SharedFolderMetadata.name: The name of the this shared folder.
:ivar sharing.SharedFolderMetadata.permissions: Actions the current user may
perform on the folder and its contents. The set of permissions
corresponds to the FolderActions in the request.
:ivar sharing.SharedFolderMetadata.policy: Policies governing this shared
folder.
:ivar sharing.SharedFolderMetadata.preview_url: URL for displaying a web
preview of the shared folder.
:ivar sharing.SharedFolderMetadata.shared_folder_id: The ID of the shared
folder.
:ivar sharing.SharedFolderMetadata.time_invited: Timestamp indicating when
the current user was invited to this shared folder.
:ivar sharing.SharedFolderMetadata.access_inheritance: Whether the folder
inherits its members from its parent.
"""
__slots__ = [
'_link_metadata_value',
'_link_metadata_present',
'_name_value',
'_name_present',
'_permissions_value',
'_permissions_present',
'_policy_value',
'_policy_present',
'_preview_url_value',
'_preview_url_present',
'_shared_folder_id_value',
'_shared_folder_id_present',
'_time_invited_value',
'_time_invited_present',
2019-08-28 21:48:24 +02:00
'_access_inheritance_value',
'_access_inheritance_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
is_inside_team_folder=None,
is_team_folder=None,
name=None,
policy=None,
preview_url=None,
shared_folder_id=None,
time_invited=None,
owner_display_names=None,
owner_team=None,
parent_shared_folder_id=None,
path_lower=None,
link_metadata=None,
2019-08-28 21:48:24 +02:00
permissions=None,
access_inheritance=None):
super(SharedFolderMetadata, self).__init__(access_type,
is_inside_team_folder,
is_team_folder,
owner_display_names,
owner_team,
parent_shared_folder_id,
path_lower)
self._link_metadata_value = None
self._link_metadata_present = False
self._name_value = None
self._name_present = False
self._permissions_value = None
self._permissions_present = False
self._policy_value = None
self._policy_present = False
self._preview_url_value = None
self._preview_url_present = False
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._time_invited_value = None
self._time_invited_present = False
2019-08-28 21:48:24 +02:00
self._access_inheritance_value = None
self._access_inheritance_present = False
if link_metadata is not None:
self.link_metadata = link_metadata
if name is not None:
self.name = name
if permissions is not None:
self.permissions = permissions
if policy is not None:
self.policy = policy
if preview_url is not None:
self.preview_url = preview_url
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if time_invited is not None:
self.time_invited = time_invited
2019-08-28 21:48:24 +02:00
if access_inheritance is not None:
self.access_inheritance = access_inheritance
@property
def link_metadata(self):
"""
The metadata of the shared content link to this shared folder. Absent if
there is no link on the folder. This is for an unreleased feature so it
may not be returned yet.
:rtype: SharedContentLinkMetadata
"""
if self._link_metadata_present:
return self._link_metadata_value
else:
return None
@link_metadata.setter
def link_metadata(self, val):
if val is None:
del self.link_metadata
return
self._link_metadata_validator.validate_type_only(val)
self._link_metadata_value = val
self._link_metadata_present = True
@link_metadata.deleter
def link_metadata(self):
self._link_metadata_value = None
self._link_metadata_present = False
@property
def name(self):
"""
The name of the this shared folder.
:rtype: str
"""
if self._name_present:
return self._name_value
else:
raise AttributeError("missing required field 'name'")
@name.setter
def name(self, val):
val = self._name_validator.validate(val)
self._name_value = val
self._name_present = True
@name.deleter
def name(self):
self._name_value = None
self._name_present = False
@property
def permissions(self):
"""
Actions the current user may perform on the folder and its contents. The
set of permissions corresponds to the FolderActions in the request.
:rtype: list of [FolderPermission]
"""
if self._permissions_present:
return self._permissions_value
else:
return None
@permissions.setter
def permissions(self, val):
if val is None:
del self.permissions
return
val = self._permissions_validator.validate(val)
self._permissions_value = val
self._permissions_present = True
@permissions.deleter
def permissions(self):
self._permissions_value = None
self._permissions_present = False
@property
def policy(self):
"""
Policies governing this shared folder.
:rtype: FolderPolicy
"""
if self._policy_present:
return self._policy_value
else:
raise AttributeError("missing required field 'policy'")
@policy.setter
def policy(self, val):
self._policy_validator.validate_type_only(val)
self._policy_value = val
self._policy_present = True
@policy.deleter
def policy(self):
self._policy_value = None
self._policy_present = False
@property
def preview_url(self):
"""
URL for displaying a web preview of the shared folder.
:rtype: str
"""
if self._preview_url_present:
return self._preview_url_value
else:
raise AttributeError("missing required field 'preview_url'")
@preview_url.setter
def preview_url(self, val):
val = self._preview_url_validator.validate(val)
self._preview_url_value = val
self._preview_url_present = True
@preview_url.deleter
def preview_url(self):
self._preview_url_value = None
self._preview_url_present = False
@property
def shared_folder_id(self):
"""
The ID of the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def time_invited(self):
"""
Timestamp indicating when the current user was invited to this shared
folder.
:rtype: datetime.datetime
"""
if self._time_invited_present:
return self._time_invited_value
else:
raise AttributeError("missing required field 'time_invited'")
@time_invited.setter
def time_invited(self, val):
val = self._time_invited_validator.validate(val)
self._time_invited_value = val
self._time_invited_present = True
@time_invited.deleter
def time_invited(self):
self._time_invited_value = None
self._time_invited_present = False
2019-08-28 21:48:24 +02:00
@property
def access_inheritance(self):
"""
Whether the folder inherits its members from its parent.
:rtype: AccessInheritance
"""
if self._access_inheritance_present:
return self._access_inheritance_value
else:
return AccessInheritance.inherit
@access_inheritance.setter
def access_inheritance(self, val):
self._access_inheritance_validator.validate_type_only(val)
self._access_inheritance_value = val
self._access_inheritance_present = True
@access_inheritance.deleter
def access_inheritance(self):
self._access_inheritance_value = None
self._access_inheritance_present = False
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedFolderMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
2019-08-28 21:48:24 +02:00
return 'SharedFolderMetadata(access_type={!r}, is_inside_team_folder={!r}, is_team_folder={!r}, name={!r}, policy={!r}, preview_url={!r}, shared_folder_id={!r}, time_invited={!r}, owner_display_names={!r}, owner_team={!r}, parent_shared_folder_id={!r}, path_lower={!r}, link_metadata={!r}, permissions={!r}, access_inheritance={!r})'.format(
self._access_type_value,
self._is_inside_team_folder_value,
self._is_team_folder_value,
self._name_value,
self._policy_value,
self._preview_url_value,
self._shared_folder_id_value,
self._time_invited_value,
self._owner_display_names_value,
self._owner_team_value,
self._parent_shared_folder_id_value,
self._path_lower_value,
self._link_metadata_value,
self._permissions_value,
2019-08-28 21:48:24 +02:00
self._access_inheritance_value,
)
SharedFolderMetadata_validator = bv.Struct(SharedFolderMetadata)
class SharedLinkAccessFailureReason(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedLinkAccessFailureReason.login_required: User is not
logged in.
:ivar sharing.SharedLinkAccessFailureReason.email_verify_required: User's
email is not verified.
:ivar sharing.SharedLinkAccessFailureReason.password_required: The link is
password protected.
:ivar sharing.SharedLinkAccessFailureReason.team_only: Access is allowed for
team members only.
:ivar sharing.SharedLinkAccessFailureReason.owner_only: Access is allowed
for the shared link's owner only.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
login_required = None
# Attribute is overwritten below the class definition
email_verify_required = None
# Attribute is overwritten below the class definition
password_required = None
# Attribute is overwritten below the class definition
team_only = None
# Attribute is overwritten below the class definition
owner_only = None
# Attribute is overwritten below the class definition
other = None
def is_login_required(self):
"""
Check if the union tag is ``login_required``.
:rtype: bool
"""
return self._tag == 'login_required'
def is_email_verify_required(self):
"""
Check if the union tag is ``email_verify_required``.
:rtype: bool
"""
return self._tag == 'email_verify_required'
def is_password_required(self):
"""
Check if the union tag is ``password_required``.
:rtype: bool
"""
return self._tag == 'password_required'
def is_team_only(self):
"""
Check if the union tag is ``team_only``.
:rtype: bool
"""
return self._tag == 'team_only'
def is_owner_only(self):
"""
Check if the union tag is ``owner_only``.
:rtype: bool
"""
return self._tag == 'owner_only'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkAccessFailureReason, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedLinkAccessFailureReason(%r, %r)' % (self._tag, self._value)
SharedLinkAccessFailureReason_validator = bv.Union(SharedLinkAccessFailureReason)
2019-08-28 21:48:24 +02:00
class SharedLinkAlreadyExistsMetadata(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 SharedLinkMetadata SharedLinkAlreadyExistsMetadata.metadata: Metadata
of the shared link that already exists.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def metadata(cls, val):
"""
Create an instance of this class set to the ``metadata`` tag with value
``val``.
:param SharedLinkMetadata val:
:rtype: SharedLinkAlreadyExistsMetadata
"""
return cls('metadata', val)
def is_metadata(self):
"""
Check if the union tag is ``metadata``.
:rtype: bool
"""
return self._tag == 'metadata'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_metadata(self):
"""
Metadata of the shared link that already exists.
Only call this if :meth:`is_metadata` is true.
:rtype: SharedLinkMetadata
"""
if not self.is_metadata():
raise AttributeError("tag 'metadata' not set")
return self._value
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkAlreadyExistsMetadata, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedLinkAlreadyExistsMetadata(%r, %r)' % (self._tag, self._value)
SharedLinkAlreadyExistsMetadata_validator = bv.Union(SharedLinkAlreadyExistsMetadata)
class SharedLinkPolicy(bb.Union):
"""
Who can view shared links in this folder.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedLinkPolicy.anyone: Links can be shared with anyone.
:ivar sharing.SharedLinkPolicy.team: Links can be shared with anyone on the
same team as the owner.
:ivar sharing.SharedLinkPolicy.members: Links can only be shared among
members of the shared folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
anyone = None
# Attribute is overwritten below the class definition
team = None
# Attribute is overwritten below the class definition
members = None
# Attribute is overwritten below the class definition
other = None
def is_anyone(self):
"""
Check if the union tag is ``anyone``.
:rtype: bool
"""
return self._tag == 'anyone'
def is_team(self):
"""
Check if the union tag is ``team``.
:rtype: bool
"""
return self._tag == 'team'
def is_members(self):
"""
Check if the union tag is ``members``.
:rtype: bool
"""
return self._tag == 'members'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkPolicy, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedLinkPolicy(%r, %r)' % (self._tag, self._value)
SharedLinkPolicy_validator = bv.Union(SharedLinkPolicy)
2019-08-28 21:48:24 +02:00
class SharedLinkSettings(bb.Struct):
"""
:ivar sharing.SharedLinkSettings.requested_visibility: The requested access
for this shared link.
:ivar sharing.SharedLinkSettings.link_password: If ``requested_visibility``
is ``RequestedVisibility.password`` this is needed to specify the
password to access the link.
:ivar sharing.SharedLinkSettings.expires: Expiration time of the shared
link. By default the link won't expire.
:ivar sharing.SharedLinkSettings.audience: The new audience who can benefit
from the access level specified by the link's access level specified in
the `link_access_level` field of `LinkPermissions`. This is used in
conjunction with team policies and shared folder policies to determine
the final effective audience type in the `effective_audience` field of
`LinkPermissions.
:ivar sharing.SharedLinkSettings.access: Requested access level you want the
audience to gain from this link.
"""
__slots__ = [
'_requested_visibility_value',
'_requested_visibility_present',
'_link_password_value',
'_link_password_present',
'_expires_value',
'_expires_present',
2019-08-28 21:48:24 +02:00
'_audience_value',
'_audience_present',
'_access_value',
'_access_present',
]
_has_required_fields = False
def __init__(self,
requested_visibility=None,
link_password=None,
2019-08-28 21:48:24 +02:00
expires=None,
audience=None,
access=None):
self._requested_visibility_value = None
self._requested_visibility_present = False
self._link_password_value = None
self._link_password_present = False
self._expires_value = None
self._expires_present = False
2019-08-28 21:48:24 +02:00
self._audience_value = None
self._audience_present = False
self._access_value = None
self._access_present = False
if requested_visibility is not None:
self.requested_visibility = requested_visibility
if link_password is not None:
self.link_password = link_password
if expires is not None:
self.expires = expires
2019-08-28 21:48:24 +02:00
if audience is not None:
self.audience = audience
if access is not None:
self.access = access
@property
def requested_visibility(self):
"""
The requested access for this shared link.
:rtype: RequestedVisibility
"""
if self._requested_visibility_present:
return self._requested_visibility_value
else:
return None
@requested_visibility.setter
def requested_visibility(self, val):
if val is None:
del self.requested_visibility
return
self._requested_visibility_validator.validate_type_only(val)
self._requested_visibility_value = val
self._requested_visibility_present = True
@requested_visibility.deleter
def requested_visibility(self):
self._requested_visibility_value = None
self._requested_visibility_present = False
@property
def link_password(self):
"""
If ``requested_visibility`` is ``RequestedVisibility.password`` this is
needed to specify the password to access the link.
:rtype: str
"""
if self._link_password_present:
return self._link_password_value
else:
return None
@link_password.setter
def link_password(self, val):
if val is None:
del self.link_password
return
val = self._link_password_validator.validate(val)
self._link_password_value = val
self._link_password_present = True
@link_password.deleter
def link_password(self):
self._link_password_value = None
self._link_password_present = False
@property
def expires(self):
"""
Expiration time of the shared link. By default the link won't expire.
:rtype: datetime.datetime
"""
if self._expires_present:
return self._expires_value
else:
return None
@expires.setter
def expires(self, val):
if val is None:
del self.expires
return
val = self._expires_validator.validate(val)
self._expires_value = val
self._expires_present = True
@expires.deleter
def expires(self):
self._expires_value = None
self._expires_present = False
2019-08-28 21:48:24 +02:00
@property
def audience(self):
"""
The new audience who can benefit from the access level specified by the
link's access level specified in the `link_access_level` field of
`LinkPermissions`. This is used in conjunction with team policies and
shared folder policies to determine the final effective audience type in
the `effective_audience` field of `LinkPermissions.
:rtype: LinkAudience
"""
if self._audience_present:
return self._audience_value
else:
return None
@audience.setter
def audience(self, val):
if val is None:
del self.audience
return
self._audience_validator.validate_type_only(val)
self._audience_value = val
self._audience_present = True
@audience.deleter
def audience(self):
self._audience_value = None
self._audience_present = False
@property
def access(self):
"""
Requested access level you want the audience to gain from this link.
:rtype: RequestedLinkAccessLevel
"""
if self._access_present:
return self._access_value
else:
return None
@access.setter
def access(self, val):
if val is None:
del self.access
return
self._access_validator.validate_type_only(val)
self._access_value = val
self._access_present = True
@access.deleter
def access(self):
self._access_value = None
self._access_present = False
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkSettings, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
2019-08-28 21:48:24 +02:00
return 'SharedLinkSettings(requested_visibility={!r}, link_password={!r}, expires={!r}, audience={!r}, access={!r})'.format(
self._requested_visibility_value,
self._link_password_value,
self._expires_value,
2019-08-28 21:48:24 +02:00
self._audience_value,
self._access_value,
)
SharedLinkSettings_validator = bv.Struct(SharedLinkSettings)
class SharedLinkSettingsError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedLinkSettingsError.invalid_settings: The given settings
are invalid (for example, all attributes of the
:class:`SharedLinkSettings` are empty, the requested visibility is
``RequestedVisibility.password`` but the
``SharedLinkSettings.link_password`` is missing,
``SharedLinkSettings.expires`` is set to the past, etc.).
2019-08-28 21:48:24 +02:00
:ivar sharing.SharedLinkSettingsError.not_authorized: User is not allowed to
modify the settings of this link. Note that basic users can only set
``RequestedVisibility.public`` as the
``SharedLinkSettings.requested_visibility`` and cannot set
``SharedLinkSettings.expires``.
"""
_catch_all = None
# Attribute is overwritten below the class definition
invalid_settings = None
# Attribute is overwritten below the class definition
not_authorized = None
def is_invalid_settings(self):
"""
Check if the union tag is ``invalid_settings``.
:rtype: bool
"""
return self._tag == 'invalid_settings'
def is_not_authorized(self):
"""
Check if the union tag is ``not_authorized``.
:rtype: bool
"""
return self._tag == 'not_authorized'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharedLinkSettingsError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharedLinkSettingsError(%r, %r)' % (self._tag, self._value)
SharedLinkSettingsError_validator = bv.Union(SharedLinkSettingsError)
class SharingFileAccessError(bb.Union):
"""
User could not access this file.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharingFileAccessError.no_permission: Current user does not
have sufficient privileges to perform the desired action.
:ivar sharing.SharingFileAccessError.invalid_file: File specified was not
found.
:ivar sharing.SharingFileAccessError.is_folder: A folder can't be shared
this way. Use folder sharing or a shared link instead.
:ivar sharing.SharingFileAccessError.inside_public_folder: A file inside a
public folder can't be shared this way. Use a public link instead.
:ivar sharing.SharingFileAccessError.inside_osx_package: A Mac OS X package
can't be shared this way. Use a shared link instead.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
invalid_file = None
# Attribute is overwritten below the class definition
is_folder = None
# Attribute is overwritten below the class definition
inside_public_folder = None
# Attribute is overwritten below the class definition
inside_osx_package = None
# Attribute is overwritten below the class definition
other = None
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_invalid_file(self):
"""
Check if the union tag is ``invalid_file``.
:rtype: bool
"""
return self._tag == 'invalid_file'
def is_is_folder(self):
"""
Check if the union tag is ``is_folder``.
:rtype: bool
"""
return self._tag == 'is_folder'
def is_inside_public_folder(self):
"""
Check if the union tag is ``inside_public_folder``.
:rtype: bool
"""
return self._tag == 'inside_public_folder'
def is_inside_osx_package(self):
"""
Check if the union tag is ``inside_osx_package``.
:rtype: bool
"""
return self._tag == 'inside_osx_package'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharingFileAccessError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharingFileAccessError(%r, %r)' % (self._tag, self._value)
SharingFileAccessError_validator = bv.Union(SharingFileAccessError)
class SharingUserError(bb.Union):
"""
User account had a problem preventing this action.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.SharingUserError.email_unverified: The current user must
verify the account e-mail address before performing this action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
email_unverified = None
# Attribute is overwritten below the class definition
other = None
def is_email_unverified(self):
"""
Check if the union tag is ``email_unverified``.
:rtype: bool
"""
return self._tag == 'email_unverified'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(SharingUserError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'SharingUserError(%r, %r)' % (self._tag, self._value)
SharingUserError_validator = bv.Union(SharingUserError)
2019-08-28 21:48:24 +02:00
class TeamMemberInfo(bb.Struct):
"""
Information about a team member.
2019-08-28 21:48:24 +02:00
:ivar sharing.TeamMemberInfo.team_info: Information about the member's team.
:ivar sharing.TeamMemberInfo.display_name: The display name of the user.
:ivar sharing.TeamMemberInfo.member_id: ID of user as a member of a team.
This field will only be present if the member is in the same team as
current user.
"""
__slots__ = [
'_team_info_value',
'_team_info_present',
'_display_name_value',
'_display_name_present',
'_member_id_value',
'_member_id_present',
]
_has_required_fields = True
def __init__(self,
team_info=None,
display_name=None,
member_id=None):
self._team_info_value = None
self._team_info_present = False
self._display_name_value = None
self._display_name_present = False
self._member_id_value = None
self._member_id_present = False
if team_info is not None:
self.team_info = team_info
if display_name is not None:
self.display_name = display_name
if member_id is not None:
self.member_id = member_id
@property
def team_info(self):
"""
Information about the member's team.
2019-08-28 21:48:24 +02:00
:rtype: users.Team
"""
if self._team_info_present:
return self._team_info_value
else:
raise AttributeError("missing required field 'team_info'")
@team_info.setter
def team_info(self, val):
val = self._team_info_validator.validate(val)
self._team_info_value = val
self._team_info_present = True
@team_info.deleter
def team_info(self):
self._team_info_value = None
self._team_info_present = False
@property
def display_name(self):
"""
The display name of the user.
:rtype: str
"""
if self._display_name_present:
return self._display_name_value
else:
raise AttributeError("missing required field 'display_name'")
@display_name.setter
def display_name(self, val):
val = self._display_name_validator.validate(val)
self._display_name_value = val
self._display_name_present = True
@display_name.deleter
def display_name(self):
self._display_name_value = None
self._display_name_present = False
@property
def member_id(self):
"""
ID of user as a member of a team. This field will only be present if the
member is in the same team as current user.
:rtype: str
"""
if self._member_id_present:
return self._member_id_value
else:
return None
@member_id.setter
def member_id(self, val):
if val is None:
del self.member_id
return
val = self._member_id_validator.validate(val)
self._member_id_value = val
self._member_id_present = True
@member_id.deleter
def member_id(self):
self._member_id_value = None
self._member_id_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TeamMemberInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'TeamMemberInfo(team_info={!r}, display_name={!r}, member_id={!r})'.format(
self._team_info_value,
self._display_name_value,
self._member_id_value,
)
TeamMemberInfo_validator = bv.Struct(TeamMemberInfo)
2019-08-28 21:48:24 +02:00
class TransferFolderArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.TransferFolderArg.shared_folder_id: The ID for the shared
folder.
:ivar sharing.TransferFolderArg.to_dropbox_id: A account or team member ID
to transfer ownership to.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_to_dropbox_id_value',
'_to_dropbox_id_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
to_dropbox_id=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._to_dropbox_id_value = None
self._to_dropbox_id_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if to_dropbox_id is not None:
self.to_dropbox_id = to_dropbox_id
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def to_dropbox_id(self):
"""
A account or team member ID to transfer ownership to.
:rtype: str
"""
if self._to_dropbox_id_present:
return self._to_dropbox_id_value
else:
raise AttributeError("missing required field 'to_dropbox_id'")
@to_dropbox_id.setter
def to_dropbox_id(self, val):
val = self._to_dropbox_id_validator.validate(val)
self._to_dropbox_id_value = val
self._to_dropbox_id_present = True
@to_dropbox_id.deleter
def to_dropbox_id(self):
self._to_dropbox_id_value = None
self._to_dropbox_id_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TransferFolderArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'TransferFolderArg(shared_folder_id={!r}, to_dropbox_id={!r})'.format(
self._shared_folder_id_value,
self._to_dropbox_id_value,
)
TransferFolderArg_validator = bv.Struct(TransferFolderArg)
class TransferFolderError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.TransferFolderError.invalid_dropbox_id:
``TransferFolderArg.to_dropbox_id`` is invalid.
:ivar sharing.TransferFolderError.new_owner_not_a_member: The new designated
owner is not currently a member of the shared folder.
:ivar sharing.TransferFolderError.new_owner_unmounted: The new designated
owner has not added the folder to their Dropbox.
:ivar sharing.TransferFolderError.new_owner_email_unverified: The new
designated owner's e-mail address is unverified.
:ivar sharing.TransferFolderError.team_folder: This action cannot be
performed on a team shared folder.
:ivar sharing.TransferFolderError.no_permission: The current user does not
have permission to perform this action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
invalid_dropbox_id = None
# Attribute is overwritten below the class definition
new_owner_not_a_member = None
# Attribute is overwritten below the class definition
new_owner_unmounted = None
# Attribute is overwritten below the class definition
new_owner_email_unverified = None
# Attribute is overwritten below the class definition
team_folder = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: TransferFolderError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_invalid_dropbox_id(self):
"""
Check if the union tag is ``invalid_dropbox_id``.
:rtype: bool
"""
return self._tag == 'invalid_dropbox_id'
def is_new_owner_not_a_member(self):
"""
Check if the union tag is ``new_owner_not_a_member``.
:rtype: bool
"""
return self._tag == 'new_owner_not_a_member'
def is_new_owner_unmounted(self):
"""
Check if the union tag is ``new_owner_unmounted``.
:rtype: bool
"""
return self._tag == 'new_owner_unmounted'
def is_new_owner_email_unverified(self):
"""
Check if the union tag is ``new_owner_email_unverified``.
:rtype: bool
"""
return self._tag == 'new_owner_email_unverified'
def is_team_folder(self):
"""
Check if the union tag is ``team_folder``.
:rtype: bool
"""
return self._tag == 'team_folder'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(TransferFolderError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'TransferFolderError(%r, %r)' % (self._tag, self._value)
TransferFolderError_validator = bv.Union(TransferFolderError)
2019-08-28 21:48:24 +02:00
class UnmountFolderArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.UnmountFolderArg.shared_folder_id: The ID for the shared
folder.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UnmountFolderArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UnmountFolderArg(shared_folder_id={!r})'.format(
self._shared_folder_id_value,
)
UnmountFolderArg_validator = bv.Struct(UnmountFolderArg)
class UnmountFolderError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.UnmountFolderError.no_permission: The current user does not
have permission to perform this action.
:ivar sharing.UnmountFolderError.not_unmountable: The shared folder can't be
unmounted. One example where this can occur is when the shared folder's
parent folder is also a shared folder that resides in the current user's
Dropbox.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
not_unmountable = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: UnmountFolderError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_not_unmountable(self):
"""
Check if the union tag is ``not_unmountable``.
:rtype: bool
"""
return self._tag == 'not_unmountable'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UnmountFolderError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UnmountFolderError(%r, %r)' % (self._tag, self._value)
UnmountFolderError_validator = bv.Union(UnmountFolderError)
2019-08-28 21:48:24 +02:00
class UnshareFileArg(bb.Struct):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.sharing_unshare_file`.
2019-08-28 21:48:24 +02:00
:ivar sharing.UnshareFileArg.file: The file to unshare.
"""
__slots__ = [
'_file_value',
'_file_present',
]
_has_required_fields = True
def __init__(self,
file=None):
self._file_value = None
self._file_present = False
if file is not None:
self.file = file
@property
def file(self):
"""
The file to unshare.
:rtype: str
"""
if self._file_present:
return self._file_value
else:
raise AttributeError("missing required field 'file'")
@file.setter
def file(self, val):
val = self._file_validator.validate(val)
self._file_value = val
self._file_present = True
@file.deleter
def file(self):
self._file_value = None
self._file_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UnshareFileArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UnshareFileArg(file={!r})'.format(
self._file_value,
)
UnshareFileArg_validator = bv.Struct(UnshareFileArg)
class UnshareFileError(bb.Union):
"""
Error result for :meth:`dropbox.dropbox.Dropbox.sharing_unshare_file`.
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 user_error(cls, val):
"""
Create an instance of this class set to the ``user_error`` tag with
value ``val``.
:param SharingUserError val:
:rtype: UnshareFileError
"""
return cls('user_error', val)
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharingFileAccessError val:
:rtype: UnshareFileError
"""
return cls('access_error', val)
def is_user_error(self):
"""
Check if the union tag is ``user_error``.
:rtype: bool
"""
return self._tag == 'user_error'
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_user_error(self):
"""
Only call this if :meth:`is_user_error` is true.
:rtype: SharingUserError
"""
if not self.is_user_error():
raise AttributeError("tag 'user_error' not set")
return self._value
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharingFileAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UnshareFileError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UnshareFileError(%r, %r)' % (self._tag, self._value)
UnshareFileError_validator = bv.Union(UnshareFileError)
2019-08-28 21:48:24 +02:00
class UnshareFolderArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.UnshareFolderArg.shared_folder_id: The ID for the shared
folder.
:ivar sharing.UnshareFolderArg.leave_a_copy: If true, members of this shared
folder will get a copy of this folder after it's unshared. Otherwise, it
will be removed from their Dropbox. The current user, who is an owner,
will always retain their copy.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_leave_a_copy_value',
'_leave_a_copy_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
leave_a_copy=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._leave_a_copy_value = None
self._leave_a_copy_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if leave_a_copy is not None:
self.leave_a_copy = leave_a_copy
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def leave_a_copy(self):
"""
If true, members of this shared folder will get a copy of this folder
after it's unshared. Otherwise, it will be removed from their Dropbox.
The current user, who is an owner, will always retain their copy.
:rtype: bool
"""
if self._leave_a_copy_present:
return self._leave_a_copy_value
else:
return False
@leave_a_copy.setter
def leave_a_copy(self, val):
val = self._leave_a_copy_validator.validate(val)
self._leave_a_copy_value = val
self._leave_a_copy_present = True
@leave_a_copy.deleter
def leave_a_copy(self):
self._leave_a_copy_value = None
self._leave_a_copy_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UnshareFolderArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UnshareFolderArg(shared_folder_id={!r}, leave_a_copy={!r})'.format(
self._shared_folder_id_value,
self._leave_a_copy_value,
)
UnshareFolderArg_validator = bv.Struct(UnshareFolderArg)
class UnshareFolderError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.UnshareFolderError.team_folder: This action cannot be
performed on a team shared folder.
:ivar sharing.UnshareFolderError.no_permission: The current user does not
have permission to perform this action.
:ivar sharing.UnshareFolderError.too_many_files: This shared folder has too
many files to be unshared.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
team_folder = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
too_many_files = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: UnshareFolderError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_team_folder(self):
"""
Check if the union tag is ``team_folder``.
:rtype: bool
"""
return self._tag == 'team_folder'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_too_many_files(self):
"""
Check if the union tag is ``too_many_files``.
:rtype: bool
"""
return self._tag == 'too_many_files'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UnshareFolderError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UnshareFolderError(%r, %r)' % (self._tag, self._value)
UnshareFolderError_validator = bv.Union(UnshareFolderError)
class UpdateFileMemberArgs(ChangeFileMemberAccessArgs):
"""
Arguments for :meth:`dropbox.dropbox.Dropbox.sharing_update_file_member`.
"""
__slots__ = [
]
_has_required_fields = True
def __init__(self,
file=None,
member=None,
access_level=None):
super(UpdateFileMemberArgs, self).__init__(file,
member,
access_level)
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateFileMemberArgs, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UpdateFileMemberArgs(file={!r}, member={!r}, access_level={!r})'.format(
self._file_value,
self._member_value,
self._access_level_value,
)
UpdateFileMemberArgs_validator = bv.Struct(UpdateFileMemberArgs)
2019-08-28 21:48:24 +02:00
class UpdateFolderMemberArg(bb.Struct):
"""
2019-08-28 21:48:24 +02:00
:ivar sharing.UpdateFolderMemberArg.shared_folder_id: The ID for the shared
folder.
:ivar sharing.UpdateFolderMemberArg.member: The member of the shared folder
to update. Only the ``MemberSelector.dropbox_id`` may be set at this
time.
:ivar sharing.UpdateFolderMemberArg.access_level: The new access level for
``member``. ``AccessLevel.owner`` is disallowed.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_member_value',
'_member_present',
'_access_level_value',
'_access_level_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
member=None,
access_level=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._member_value = None
self._member_present = False
self._access_level_value = None
self._access_level_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if member is not None:
self.member = member
if access_level is not None:
self.access_level = access_level
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def member(self):
"""
The member of the shared folder to update. Only the
``MemberSelector.dropbox_id`` may be set at this time.
:rtype: MemberSelector
"""
if self._member_present:
return self._member_value
else:
raise AttributeError("missing required field 'member'")
@member.setter
def member(self, val):
self._member_validator.validate_type_only(val)
self._member_value = val
self._member_present = True
@member.deleter
def member(self):
self._member_value = None
self._member_present = False
@property
def access_level(self):
"""
The new access level for ``member``. ``AccessLevel.owner`` is
disallowed.
:rtype: AccessLevel
"""
if self._access_level_present:
return self._access_level_value
else:
raise AttributeError("missing required field 'access_level'")
@access_level.setter
def access_level(self, val):
self._access_level_validator.validate_type_only(val)
self._access_level_value = val
self._access_level_present = True
@access_level.deleter
def access_level(self):
self._access_level_value = None
self._access_level_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateFolderMemberArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UpdateFolderMemberArg(shared_folder_id={!r}, member={!r}, access_level={!r})'.format(
self._shared_folder_id_value,
self._member_value,
self._access_level_value,
)
UpdateFolderMemberArg_validator = bv.Struct(UpdateFolderMemberArg)
class UpdateFolderMemberError(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.
2019-08-28 21:48:24 +02:00
:ivar AddFolderMemberError UpdateFolderMemberError.no_explicit_access: If
updating the access type required the member to be added to the shared
folder and there was an error when adding the member.
:ivar sharing.UpdateFolderMemberError.insufficient_plan: The current user's
account doesn't support this action. An example of this is when
downgrading a member from editor to viewer. This action can only be
performed by users that have upgraded to a Pro or Business plan.
:ivar sharing.UpdateFolderMemberError.no_permission: The current user does
not have permission to perform this action.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
insufficient_plan = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: UpdateFolderMemberError
"""
return cls('access_error', val)
@classmethod
def member_error(cls, val):
"""
Create an instance of this class set to the ``member_error`` tag with
value ``val``.
:param SharedFolderMemberError val:
:rtype: UpdateFolderMemberError
"""
return cls('member_error', val)
@classmethod
def no_explicit_access(cls, val):
"""
Create an instance of this class set to the ``no_explicit_access`` tag
with value ``val``.
:param AddFolderMemberError val:
:rtype: UpdateFolderMemberError
"""
return cls('no_explicit_access', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_member_error(self):
"""
Check if the union tag is ``member_error``.
:rtype: bool
"""
return self._tag == 'member_error'
def is_no_explicit_access(self):
"""
Check if the union tag is ``no_explicit_access``.
:rtype: bool
"""
return self._tag == 'no_explicit_access'
def is_insufficient_plan(self):
"""
Check if the union tag is ``insufficient_plan``.
:rtype: bool
"""
return self._tag == 'insufficient_plan'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
def get_member_error(self):
"""
Only call this if :meth:`is_member_error` is true.
:rtype: SharedFolderMemberError
"""
if not self.is_member_error():
raise AttributeError("tag 'member_error' not set")
return self._value
def get_no_explicit_access(self):
"""
If updating the access type required the member to be added to the
shared folder and there was an error when adding the member.
Only call this if :meth:`is_no_explicit_access` is true.
:rtype: AddFolderMemberError
"""
if not self.is_no_explicit_access():
raise AttributeError("tag 'no_explicit_access' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateFolderMemberError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UpdateFolderMemberError(%r, %r)' % (self._tag, self._value)
UpdateFolderMemberError_validator = bv.Union(UpdateFolderMemberError)
2019-08-28 21:48:24 +02:00
class UpdateFolderPolicyArg(bb.Struct):
"""
If any of the policies are unset, then they retain their current setting.
2019-08-28 21:48:24 +02:00
:ivar sharing.UpdateFolderPolicyArg.shared_folder_id: The ID for the shared
folder.
2019-08-28 21:48:24 +02:00
:ivar sharing.UpdateFolderPolicyArg.member_policy: Who can be a member of
this shared folder. Only applicable if the current user is on a team.
:ivar sharing.UpdateFolderPolicyArg.acl_update_policy: Who can add and
remove members of this shared folder.
:ivar sharing.UpdateFolderPolicyArg.viewer_info_policy: Who can
enable/disable viewer info for this shared folder.
:ivar sharing.UpdateFolderPolicyArg.shared_link_policy: The policy to apply
to shared links created for content inside this shared folder. The
current user must be on a team to set this policy to
``SharedLinkPolicy.members``.
:ivar sharing.UpdateFolderPolicyArg.link_settings: Settings on the link for
this folder.
:ivar sharing.UpdateFolderPolicyArg.actions: A list of `FolderAction`s
corresponding to `FolderPermission`s that should appear in the
response's ``SharedFolderMetadata.permissions`` field describing the
actions the authenticated user can perform on the folder.
"""
__slots__ = [
'_shared_folder_id_value',
'_shared_folder_id_present',
'_member_policy_value',
'_member_policy_present',
'_acl_update_policy_value',
'_acl_update_policy_present',
'_viewer_info_policy_value',
'_viewer_info_policy_present',
'_shared_link_policy_value',
'_shared_link_policy_present',
'_link_settings_value',
'_link_settings_present',
'_actions_value',
'_actions_present',
]
_has_required_fields = True
def __init__(self,
shared_folder_id=None,
member_policy=None,
acl_update_policy=None,
viewer_info_policy=None,
shared_link_policy=None,
link_settings=None,
actions=None):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
self._member_policy_value = None
self._member_policy_present = False
self._acl_update_policy_value = None
self._acl_update_policy_present = False
self._viewer_info_policy_value = None
self._viewer_info_policy_present = False
self._shared_link_policy_value = None
self._shared_link_policy_present = False
self._link_settings_value = None
self._link_settings_present = False
self._actions_value = None
self._actions_present = False
if shared_folder_id is not None:
self.shared_folder_id = shared_folder_id
if member_policy is not None:
self.member_policy = member_policy
if acl_update_policy is not None:
self.acl_update_policy = acl_update_policy
if viewer_info_policy is not None:
self.viewer_info_policy = viewer_info_policy
if shared_link_policy is not None:
self.shared_link_policy = shared_link_policy
if link_settings is not None:
self.link_settings = link_settings
if actions is not None:
self.actions = actions
@property
def shared_folder_id(self):
"""
The ID for the shared folder.
:rtype: str
"""
if self._shared_folder_id_present:
return self._shared_folder_id_value
else:
raise AttributeError("missing required field 'shared_folder_id'")
@shared_folder_id.setter
def shared_folder_id(self, val):
val = self._shared_folder_id_validator.validate(val)
self._shared_folder_id_value = val
self._shared_folder_id_present = True
@shared_folder_id.deleter
def shared_folder_id(self):
self._shared_folder_id_value = None
self._shared_folder_id_present = False
@property
def member_policy(self):
"""
Who can be a member of this shared folder. Only applicable if the
current user is on a team.
:rtype: MemberPolicy
"""
if self._member_policy_present:
return self._member_policy_value
else:
return None
@member_policy.setter
def member_policy(self, val):
if val is None:
del self.member_policy
return
self._member_policy_validator.validate_type_only(val)
self._member_policy_value = val
self._member_policy_present = True
@member_policy.deleter
def member_policy(self):
self._member_policy_value = None
self._member_policy_present = False
@property
def acl_update_policy(self):
"""
Who can add and remove members of this shared folder.
:rtype: AclUpdatePolicy
"""
if self._acl_update_policy_present:
return self._acl_update_policy_value
else:
return None
@acl_update_policy.setter
def acl_update_policy(self, val):
if val is None:
del self.acl_update_policy
return
self._acl_update_policy_validator.validate_type_only(val)
self._acl_update_policy_value = val
self._acl_update_policy_present = True
@acl_update_policy.deleter
def acl_update_policy(self):
self._acl_update_policy_value = None
self._acl_update_policy_present = False
@property
def viewer_info_policy(self):
"""
Who can enable/disable viewer info for this shared folder.
:rtype: ViewerInfoPolicy
"""
if self._viewer_info_policy_present:
return self._viewer_info_policy_value
else:
return None
@viewer_info_policy.setter
def viewer_info_policy(self, val):
if val is None:
del self.viewer_info_policy
return
self._viewer_info_policy_validator.validate_type_only(val)
self._viewer_info_policy_value = val
self._viewer_info_policy_present = True
@viewer_info_policy.deleter
def viewer_info_policy(self):
self._viewer_info_policy_value = None
self._viewer_info_policy_present = False
@property
def shared_link_policy(self):
"""
The policy to apply to shared links created for content inside this
shared folder. The current user must be on a team to set this policy to
``SharedLinkPolicy.members``.
:rtype: SharedLinkPolicy
"""
if self._shared_link_policy_present:
return self._shared_link_policy_value
else:
return None
@shared_link_policy.setter
def shared_link_policy(self, val):
if val is None:
del self.shared_link_policy
return
self._shared_link_policy_validator.validate_type_only(val)
self._shared_link_policy_value = val
self._shared_link_policy_present = True
@shared_link_policy.deleter
def shared_link_policy(self):
self._shared_link_policy_value = None
self._shared_link_policy_present = False
@property
def link_settings(self):
"""
Settings on the link for this folder.
:rtype: LinkSettings
"""
if self._link_settings_present:
return self._link_settings_value
else:
return None
@link_settings.setter
def link_settings(self, val):
if val is None:
del self.link_settings
return
self._link_settings_validator.validate_type_only(val)
self._link_settings_value = val
self._link_settings_present = True
@link_settings.deleter
def link_settings(self):
self._link_settings_value = None
self._link_settings_present = False
@property
def actions(self):
"""
A list of `FolderAction`s corresponding to `FolderPermission`s that
should appear in the response's ``SharedFolderMetadata.permissions``
field describing the actions the authenticated user can perform on the
folder.
:rtype: list of [FolderAction]
"""
if self._actions_present:
return self._actions_value
else:
return None
@actions.setter
def actions(self, val):
if val is None:
del self.actions
return
val = self._actions_validator.validate(val)
self._actions_value = val
self._actions_present = True
@actions.deleter
def actions(self):
self._actions_value = None
self._actions_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateFolderPolicyArg, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UpdateFolderPolicyArg(shared_folder_id={!r}, member_policy={!r}, acl_update_policy={!r}, viewer_info_policy={!r}, shared_link_policy={!r}, link_settings={!r}, actions={!r})'.format(
self._shared_folder_id_value,
self._member_policy_value,
self._acl_update_policy_value,
self._viewer_info_policy_value,
self._shared_link_policy_value,
self._link_settings_value,
self._actions_value,
)
UpdateFolderPolicyArg_validator = bv.Struct(UpdateFolderPolicyArg)
class UpdateFolderPolicyError(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.UpdateFolderPolicyError.not_on_team:
``UpdateFolderPolicyArg.member_policy`` was set even though user is not
on a team.
:ivar sharing.UpdateFolderPolicyError.team_policy_disallows_member_policy:
Team policy is more restrictive than ``ShareFolderArg.member_policy``.
:ivar sharing.UpdateFolderPolicyError.disallowed_shared_link_policy: The
current account is not allowed to select the specified
``ShareFolderArg.shared_link_policy``.
:ivar sharing.UpdateFolderPolicyError.no_permission: The current user does
not have permission to perform this action.
:ivar sharing.UpdateFolderPolicyError.team_folder: This action cannot be
performed on a team shared folder.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
not_on_team = None
# Attribute is overwritten below the class definition
team_policy_disallows_member_policy = None
# Attribute is overwritten below the class definition
disallowed_shared_link_policy = None
# Attribute is overwritten below the class definition
no_permission = None
# Attribute is overwritten below the class definition
team_folder = None
# Attribute is overwritten below the class definition
other = None
@classmethod
def access_error(cls, val):
"""
Create an instance of this class set to the ``access_error`` tag with
value ``val``.
:param SharedFolderAccessError val:
:rtype: UpdateFolderPolicyError
"""
return cls('access_error', val)
def is_access_error(self):
"""
Check if the union tag is ``access_error``.
:rtype: bool
"""
return self._tag == 'access_error'
def is_not_on_team(self):
"""
Check if the union tag is ``not_on_team``.
:rtype: bool
"""
return self._tag == 'not_on_team'
def is_team_policy_disallows_member_policy(self):
"""
Check if the union tag is ``team_policy_disallows_member_policy``.
:rtype: bool
"""
return self._tag == 'team_policy_disallows_member_policy'
def is_disallowed_shared_link_policy(self):
"""
Check if the union tag is ``disallowed_shared_link_policy``.
:rtype: bool
"""
return self._tag == 'disallowed_shared_link_policy'
def is_no_permission(self):
"""
Check if the union tag is ``no_permission``.
:rtype: bool
"""
return self._tag == 'no_permission'
def is_team_folder(self):
"""
Check if the union tag is ``team_folder``.
:rtype: bool
"""
return self._tag == 'team_folder'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def get_access_error(self):
"""
Only call this if :meth:`is_access_error` is true.
:rtype: SharedFolderAccessError
"""
if not self.is_access_error():
raise AttributeError("tag 'access_error' not set")
return self._value
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UpdateFolderPolicyError, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UpdateFolderPolicyError(%r, %r)' % (self._tag, self._value)
UpdateFolderPolicyError_validator = bv.Union(UpdateFolderPolicyError)
class UserMembershipInfo(MembershipInfo):
"""
The information about a user member of the shared content.
2019-08-28 21:48:24 +02:00
:ivar sharing.UserMembershipInfo.user: The account information for the
membership user.
"""
__slots__ = [
'_user_value',
'_user_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
user=None,
permissions=None,
initials=None,
is_inherited=None):
super(UserMembershipInfo, self).__init__(access_type,
permissions,
initials,
is_inherited)
self._user_value = None
self._user_present = False
if user is not None:
self.user = user
@property
def user(self):
"""
The account information for the membership user.
:rtype: UserInfo
"""
if self._user_present:
return self._user_value
else:
raise AttributeError("missing required field 'user'")
@user.setter
def user(self, val):
self._user_validator.validate_type_only(val)
self._user_value = val
self._user_present = True
@user.deleter
def user(self):
self._user_value = None
self._user_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UserMembershipInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'UserMembershipInfo(access_type={!r}, user={!r}, permissions={!r}, initials={!r}, is_inherited={!r})'.format(
self._access_type_value,
self._user_value,
self._permissions_value,
self._initials_value,
self._is_inherited_value,
)
UserMembershipInfo_validator = bv.Struct(UserMembershipInfo)
class UserFileMembershipInfo(UserMembershipInfo):
"""
The information about a user member of the shared content with an appended
last seen timestamp.
2019-08-28 21:48:24 +02:00
:ivar sharing.UserFileMembershipInfo.time_last_seen: The UTC timestamp of
when the user has last seen the content, if they have.
:ivar sharing.UserFileMembershipInfo.platform_type: The platform on which
the user has last seen the content, or unknown.
"""
__slots__ = [
'_time_last_seen_value',
'_time_last_seen_present',
2019-08-28 21:48:24 +02:00
'_platform_type_value',
'_platform_type_present',
]
_has_required_fields = True
def __init__(self,
access_type=None,
user=None,
permissions=None,
initials=None,
is_inherited=None,
2019-08-28 21:48:24 +02:00
time_last_seen=None,
platform_type=None):
super(UserFileMembershipInfo, self).__init__(access_type,
user,
permissions,
initials,
is_inherited)
self._time_last_seen_value = None
self._time_last_seen_present = False
2019-08-28 21:48:24 +02:00
self._platform_type_value = None
self._platform_type_present = False
if time_last_seen is not None:
self.time_last_seen = time_last_seen
2019-08-28 21:48:24 +02:00
if platform_type is not None:
self.platform_type = platform_type
@property
def time_last_seen(self):
"""
The UTC timestamp of when the user has last seen the content, if they
have.
:rtype: datetime.datetime
"""
if self._time_last_seen_present:
return self._time_last_seen_value
else:
return None
@time_last_seen.setter
def time_last_seen(self, val):
if val is None:
del self.time_last_seen
return
val = self._time_last_seen_validator.validate(val)
self._time_last_seen_value = val
self._time_last_seen_present = True
@time_last_seen.deleter
def time_last_seen(self):
self._time_last_seen_value = None
self._time_last_seen_present = False
2019-08-28 21:48:24 +02:00
@property
def platform_type(self):
"""
The platform on which the user has last seen the content, or unknown.
:rtype: seen_state.PlatformType
"""
if self._platform_type_present:
return self._platform_type_value
else:
return None
@platform_type.setter
def platform_type(self, val):
if val is None:
del self.platform_type
return
self._platform_type_validator.validate_type_only(val)
self._platform_type_value = val
self._platform_type_present = True
@platform_type.deleter
def platform_type(self):
self._platform_type_value = None
self._platform_type_present = False
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UserFileMembershipInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
2019-08-28 21:48:24 +02:00
return 'UserFileMembershipInfo(access_type={!r}, user={!r}, permissions={!r}, initials={!r}, is_inherited={!r}, time_last_seen={!r}, platform_type={!r})'.format(
self._access_type_value,
self._user_value,
self._permissions_value,
self._initials_value,
self._is_inherited_value,
self._time_last_seen_value,
2019-08-28 21:48:24 +02:00
self._platform_type_value,
)
UserFileMembershipInfo_validator = bv.Struct(UserFileMembershipInfo)
2019-08-28 21:48:24 +02:00
class UserInfo(bb.Struct):
"""
Basic information about a user. Use
:meth:`dropbox.dropbox.Dropbox.sharing_users_account` and
:meth:`dropbox.dropbox.Dropbox.sharing_users_account_batch` to obtain more
detailed information.
2019-08-28 21:48:24 +02:00
:ivar sharing.UserInfo.account_id: The account ID of the user.
:ivar sharing.UserInfo.email: Email address of user.
:ivar sharing.UserInfo.display_name: The display name of the user.
:ivar sharing.UserInfo.same_team: If the user is in the same team as current
user.
:ivar sharing.UserInfo.team_member_id: The team member ID of the shared
folder member. Only present if ``same_team`` is true.
"""
__slots__ = [
'_account_id_value',
'_account_id_present',
2019-08-28 21:48:24 +02:00
'_email_value',
'_email_present',
'_display_name_value',
'_display_name_present',
'_same_team_value',
'_same_team_present',
'_team_member_id_value',
'_team_member_id_present',
]
_has_required_fields = True
def __init__(self,
account_id=None,
2019-08-28 21:48:24 +02:00
email=None,
display_name=None,
same_team=None,
team_member_id=None):
self._account_id_value = None
self._account_id_present = False
2019-08-28 21:48:24 +02:00
self._email_value = None
self._email_present = False
self._display_name_value = None
self._display_name_present = False
self._same_team_value = None
self._same_team_present = False
self._team_member_id_value = None
self._team_member_id_present = False
if account_id is not None:
self.account_id = account_id
2019-08-28 21:48:24 +02:00
if email is not None:
self.email = email
if display_name is not None:
self.display_name = display_name
if same_team is not None:
self.same_team = same_team
if team_member_id is not None:
self.team_member_id = team_member_id
@property
def account_id(self):
"""
The account ID of the user.
:rtype: str
"""
if self._account_id_present:
return self._account_id_value
else:
raise AttributeError("missing required field 'account_id'")
@account_id.setter
def account_id(self, val):
val = self._account_id_validator.validate(val)
self._account_id_value = val
self._account_id_present = True
@account_id.deleter
def account_id(self):
self._account_id_value = None
self._account_id_present = False
2019-08-28 21:48:24 +02:00
@property
def email(self):
"""
Email address of user.
:rtype: str
"""
if self._email_present:
return self._email_value
else:
raise AttributeError("missing required field 'email'")
@email.setter
def email(self, val):
val = self._email_validator.validate(val)
self._email_value = val
self._email_present = True
@email.deleter
def email(self):
self._email_value = None
self._email_present = False
@property
def display_name(self):
"""
The display name of the user.
:rtype: str
"""
if self._display_name_present:
return self._display_name_value
else:
raise AttributeError("missing required field 'display_name'")
@display_name.setter
def display_name(self, val):
val = self._display_name_validator.validate(val)
self._display_name_value = val
self._display_name_present = True
@display_name.deleter
def display_name(self):
self._display_name_value = None
self._display_name_present = False
@property
def same_team(self):
"""
If the user is in the same team as current user.
:rtype: bool
"""
if self._same_team_present:
return self._same_team_value
else:
raise AttributeError("missing required field 'same_team'")
@same_team.setter
def same_team(self, val):
val = self._same_team_validator.validate(val)
self._same_team_value = val
self._same_team_present = True
@same_team.deleter
def same_team(self):
self._same_team_value = None
self._same_team_present = False
@property
def team_member_id(self):
"""
The team member ID of the shared folder member. Only present if
``same_team`` is true.
:rtype: str
"""
if self._team_member_id_present:
return self._team_member_id_value
else:
return None
@team_member_id.setter
def team_member_id(self, val):
if val is None:
del self.team_member_id
return
val = self._team_member_id_validator.validate(val)
self._team_member_id_value = val
self._team_member_id_present = True
@team_member_id.deleter
def team_member_id(self):
self._team_member_id_value = None
self._team_member_id_present = False
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(UserInfo, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
2019-08-28 21:48:24 +02:00
return 'UserInfo(account_id={!r}, email={!r}, display_name={!r}, same_team={!r}, team_member_id={!r})'.format(
self._account_id_value,
2019-08-28 21:48:24 +02:00
self._email_value,
self._display_name_value,
self._same_team_value,
self._team_member_id_value,
)
UserInfo_validator = bv.Struct(UserInfo)
class ViewerInfoPolicy(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.
2019-08-28 21:48:24 +02:00
:ivar sharing.ViewerInfoPolicy.enabled: Viewer information is available on
this file.
:ivar sharing.ViewerInfoPolicy.disabled: Viewer information is disabled on
this file.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
enabled = None
# Attribute is overwritten below the class definition
disabled = None
# Attribute is overwritten below the class definition
other = None
def is_enabled(self):
"""
Check if the union tag is ``enabled``.
:rtype: bool
"""
return self._tag == 'enabled'
def is_disabled(self):
"""
Check if the union tag is ``disabled``.
:rtype: bool
"""
return self._tag == 'disabled'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(ViewerInfoPolicy, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'ViewerInfoPolicy(%r, %r)' % (self._tag, self._value)
ViewerInfoPolicy_validator = bv.Union(ViewerInfoPolicy)
class Visibility(bb.Union):
"""
Who can access a shared link. The most open visibility is ``public``. The
default depends on many aspects, such as team and user preferences and
shared folder settings.
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.
2019-08-28 21:48:24 +02:00
:ivar sharing.Visibility.public: Anyone who has received the link can access
it. No login required.
:ivar sharing.Visibility.team_only: Only members of the same team can access
the link. Login is required.
:ivar sharing.Visibility.password: A link-specific password is required to
access the link. Login is not required.
:ivar sharing.Visibility.team_and_password: Only members of the same team
who have the link-specific password can access the link.
:ivar sharing.Visibility.shared_folder_only: Only members of the shared
folder containing the linked file can access the link. Login is
required.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
public = None
# Attribute is overwritten below the class definition
team_only = None
# Attribute is overwritten below the class definition
password = None
# Attribute is overwritten below the class definition
team_and_password = None
# Attribute is overwritten below the class definition
shared_folder_only = None
# Attribute is overwritten below the class definition
other = None
def is_public(self):
"""
Check if the union tag is ``public``.
:rtype: bool
"""
return self._tag == 'public'
def is_team_only(self):
"""
Check if the union tag is ``team_only``.
:rtype: bool
"""
return self._tag == 'team_only'
def is_password(self):
"""
Check if the union tag is ``password``.
:rtype: bool
"""
return self._tag == 'password'
def is_team_and_password(self):
"""
Check if the union tag is ``team_and_password``.
:rtype: bool
"""
return self._tag == 'team_and_password'
def is_shared_folder_only(self):
"""
Check if the union tag is ``shared_folder_only``.
:rtype: bool
"""
return self._tag == 'shared_folder_only'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
2019-08-28 21:48:24 +02:00
def _process_custom_annotations(self, annotation_type, field_path, processor):
super(Visibility, self)._process_custom_annotations(annotation_type, field_path, processor)
def __repr__(self):
return 'Visibility(%r, %r)' % (self._tag, self._value)
Visibility_validator = bv.Union(Visibility)
DropboxId_validator = bv.String(min_length=1)
GetSharedLinkFileArg_validator = GetSharedLinkMetadataArg_validator
GetSharedLinkFileArg = GetSharedLinkMetadataArg
Id_validator = files.Id_validator
Path_validator = files.Path_validator
PathOrId_validator = bv.String(min_length=1, pattern=u'((/|id:).*|nspath:[0-9]+:.*)|ns:[0-9]+(/.*)?')
ReadPath_validator = files.ReadPath_validator
Rev_validator = files.Rev_validator
TeamInfo_validator = users.Team_validator
TeamInfo = users.Team
2019-08-28 21:48:24 +02:00
AccessInheritance._inherit_validator = bv.Void()
AccessInheritance._no_inherit_validator = bv.Void()
AccessInheritance._other_validator = bv.Void()
AccessInheritance._tagmap = {
'inherit': AccessInheritance._inherit_validator,
'no_inherit': AccessInheritance._no_inherit_validator,
'other': AccessInheritance._other_validator,
}
AccessInheritance.inherit = AccessInheritance('inherit')
AccessInheritance.no_inherit = AccessInheritance('no_inherit')
AccessInheritance.other = AccessInheritance('other')
AccessLevel._owner_validator = bv.Void()
AccessLevel._editor_validator = bv.Void()
AccessLevel._viewer_validator = bv.Void()
AccessLevel._viewer_no_comment_validator = bv.Void()
AccessLevel._other_validator = bv.Void()
AccessLevel._tagmap = {
'owner': AccessLevel._owner_validator,
'editor': AccessLevel._editor_validator,
'viewer': AccessLevel._viewer_validator,
'viewer_no_comment': AccessLevel._viewer_no_comment_validator,
'other': AccessLevel._other_validator,
}
AccessLevel.owner = AccessLevel('owner')
AccessLevel.editor = AccessLevel('editor')
AccessLevel.viewer = AccessLevel('viewer')
AccessLevel.viewer_no_comment = AccessLevel('viewer_no_comment')
AccessLevel.other = AccessLevel('other')
AclUpdatePolicy._owner_validator = bv.Void()
AclUpdatePolicy._editors_validator = bv.Void()
AclUpdatePolicy._other_validator = bv.Void()
AclUpdatePolicy._tagmap = {
'owner': AclUpdatePolicy._owner_validator,
'editors': AclUpdatePolicy._editors_validator,
'other': AclUpdatePolicy._other_validator,
}
AclUpdatePolicy.owner = AclUpdatePolicy('owner')
AclUpdatePolicy.editors = AclUpdatePolicy('editors')
AclUpdatePolicy.other = AclUpdatePolicy('other')
AddFileMemberArgs._file_validator = PathOrId_validator
AddFileMemberArgs._members_validator = bv.List(MemberSelector_validator)
AddFileMemberArgs._custom_message_validator = bv.Nullable(bv.String())
AddFileMemberArgs._quiet_validator = bv.Boolean()
AddFileMemberArgs._access_level_validator = AccessLevel_validator
AddFileMemberArgs._add_message_as_comment_validator = bv.Boolean()
AddFileMemberArgs._all_field_names_ = set([
'file',
'members',
'custom_message',
'quiet',
'access_level',
'add_message_as_comment',
])
AddFileMemberArgs._all_fields_ = [
('file', AddFileMemberArgs._file_validator),
('members', AddFileMemberArgs._members_validator),
('custom_message', AddFileMemberArgs._custom_message_validator),
('quiet', AddFileMemberArgs._quiet_validator),
('access_level', AddFileMemberArgs._access_level_validator),
('add_message_as_comment', AddFileMemberArgs._add_message_as_comment_validator),
]
AddFileMemberError._user_error_validator = SharingUserError_validator
AddFileMemberError._access_error_validator = SharingFileAccessError_validator
AddFileMemberError._rate_limit_validator = bv.Void()
AddFileMemberError._invalid_comment_validator = bv.Void()
AddFileMemberError._other_validator = bv.Void()
AddFileMemberError._tagmap = {
'user_error': AddFileMemberError._user_error_validator,
'access_error': AddFileMemberError._access_error_validator,
'rate_limit': AddFileMemberError._rate_limit_validator,
'invalid_comment': AddFileMemberError._invalid_comment_validator,
'other': AddFileMemberError._other_validator,
}
AddFileMemberError.rate_limit = AddFileMemberError('rate_limit')
AddFileMemberError.invalid_comment = AddFileMemberError('invalid_comment')
AddFileMemberError.other = AddFileMemberError('other')
AddFolderMemberArg._shared_folder_id_validator = common.SharedFolderId_validator
AddFolderMemberArg._members_validator = bv.List(AddMember_validator)
AddFolderMemberArg._quiet_validator = bv.Boolean()
AddFolderMemberArg._custom_message_validator = bv.Nullable(bv.String(min_length=1))
AddFolderMemberArg._all_field_names_ = set([
'shared_folder_id',
'members',
'quiet',
'custom_message',
])
AddFolderMemberArg._all_fields_ = [
('shared_folder_id', AddFolderMemberArg._shared_folder_id_validator),
('members', AddFolderMemberArg._members_validator),
('quiet', AddFolderMemberArg._quiet_validator),
('custom_message', AddFolderMemberArg._custom_message_validator),
]
AddFolderMemberError._access_error_validator = SharedFolderAccessError_validator
AddFolderMemberError._email_unverified_validator = bv.Void()
2019-08-28 21:48:24 +02:00
AddFolderMemberError._banned_member_validator = bv.Void()
AddFolderMemberError._bad_member_validator = AddMemberSelectorError_validator
AddFolderMemberError._cant_share_outside_team_validator = bv.Void()
AddFolderMemberError._too_many_members_validator = bv.UInt64()
AddFolderMemberError._too_many_pending_invites_validator = bv.UInt64()
AddFolderMemberError._rate_limit_validator = bv.Void()
AddFolderMemberError._too_many_invitees_validator = bv.Void()
AddFolderMemberError._insufficient_plan_validator = bv.Void()
AddFolderMemberError._team_folder_validator = bv.Void()
AddFolderMemberError._no_permission_validator = bv.Void()
AddFolderMemberError._other_validator = bv.Void()
AddFolderMemberError._tagmap = {
'access_error': AddFolderMemberError._access_error_validator,
'email_unverified': AddFolderMemberError._email_unverified_validator,
2019-08-28 21:48:24 +02:00
'banned_member': AddFolderMemberError._banned_member_validator,
'bad_member': AddFolderMemberError._bad_member_validator,
'cant_share_outside_team': AddFolderMemberError._cant_share_outside_team_validator,
'too_many_members': AddFolderMemberError._too_many_members_validator,
'too_many_pending_invites': AddFolderMemberError._too_many_pending_invites_validator,
'rate_limit': AddFolderMemberError._rate_limit_validator,
'too_many_invitees': AddFolderMemberError._too_many_invitees_validator,
'insufficient_plan': AddFolderMemberError._insufficient_plan_validator,
'team_folder': AddFolderMemberError._team_folder_validator,
'no_permission': AddFolderMemberError._no_permission_validator,
'other': AddFolderMemberError._other_validator,
}
AddFolderMemberError.email_unverified = AddFolderMemberError('email_unverified')
2019-08-28 21:48:24 +02:00
AddFolderMemberError.banned_member = AddFolderMemberError('banned_member')
AddFolderMemberError.cant_share_outside_team = AddFolderMemberError('cant_share_outside_team')
AddFolderMemberError.rate_limit = AddFolderMemberError('rate_limit')
AddFolderMemberError.too_many_invitees = AddFolderMemberError('too_many_invitees')
AddFolderMemberError.insufficient_plan = AddFolderMemberError('insufficient_plan')
AddFolderMemberError.team_folder = AddFolderMemberError('team_folder')
AddFolderMemberError.no_permission = AddFolderMemberError('no_permission')
AddFolderMemberError.other = AddFolderMemberError('other')
AddMember._member_validator = MemberSelector_validator
AddMember._access_level_validator = AccessLevel_validator
AddMember._all_field_names_ = set([
'member',
'access_level',
])
AddMember._all_fields_ = [
('member', AddMember._member_validator),
('access_level', AddMember._access_level_validator),
]
AddMemberSelectorError._automatic_group_validator = bv.Void()
AddMemberSelectorError._invalid_dropbox_id_validator = DropboxId_validator
AddMemberSelectorError._invalid_email_validator = common.EmailAddress_validator
AddMemberSelectorError._unverified_dropbox_id_validator = DropboxId_validator
AddMemberSelectorError._group_deleted_validator = bv.Void()
AddMemberSelectorError._group_not_on_team_validator = bv.Void()
AddMemberSelectorError._other_validator = bv.Void()
AddMemberSelectorError._tagmap = {
'automatic_group': AddMemberSelectorError._automatic_group_validator,
'invalid_dropbox_id': AddMemberSelectorError._invalid_dropbox_id_validator,
'invalid_email': AddMemberSelectorError._invalid_email_validator,
'unverified_dropbox_id': AddMemberSelectorError._unverified_dropbox_id_validator,
'group_deleted': AddMemberSelectorError._group_deleted_validator,
'group_not_on_team': AddMemberSelectorError._group_not_on_team_validator,
'other': AddMemberSelectorError._other_validator,
}
AddMemberSelectorError.automatic_group = AddMemberSelectorError('automatic_group')
AddMemberSelectorError.group_deleted = AddMemberSelectorError('group_deleted')
AddMemberSelectorError.group_not_on_team = AddMemberSelectorError('group_not_on_team')
AddMemberSelectorError.other = AddMemberSelectorError('other')
AudienceExceptionContentInfo._name_validator = bv.String()
AudienceExceptionContentInfo._all_field_names_ = set(['name'])
AudienceExceptionContentInfo._all_fields_ = [('name', AudienceExceptionContentInfo._name_validator)]
AudienceExceptions._count_validator = bv.UInt32()
AudienceExceptions._exceptions_validator = bv.List(AudienceExceptionContentInfo_validator)
AudienceExceptions._all_field_names_ = set([
'count',
'exceptions',
])
AudienceExceptions._all_fields_ = [
('count', AudienceExceptions._count_validator),
('exceptions', AudienceExceptions._exceptions_validator),
]
AudienceRestrictingSharedFolder._shared_folder_id_validator = common.SharedFolderId_validator
AudienceRestrictingSharedFolder._name_validator = bv.String()
AudienceRestrictingSharedFolder._audience_validator = LinkAudience_validator
AudienceRestrictingSharedFolder._all_field_names_ = set([
'shared_folder_id',
'name',
'audience',
])
AudienceRestrictingSharedFolder._all_fields_ = [
('shared_folder_id', AudienceRestrictingSharedFolder._shared_folder_id_validator),
('name', AudienceRestrictingSharedFolder._name_validator),
('audience', AudienceRestrictingSharedFolder._audience_validator),
]
ChangeFileMemberAccessArgs._file_validator = PathOrId_validator
ChangeFileMemberAccessArgs._member_validator = MemberSelector_validator
ChangeFileMemberAccessArgs._access_level_validator = AccessLevel_validator
ChangeFileMemberAccessArgs._all_field_names_ = set([
'file',
'member',
'access_level',
])
ChangeFileMemberAccessArgs._all_fields_ = [
('file', ChangeFileMemberAccessArgs._file_validator),
('member', ChangeFileMemberAccessArgs._member_validator),
('access_level', ChangeFileMemberAccessArgs._access_level_validator),
]
LinkMetadata._url_validator = bv.String()
LinkMetadata._visibility_validator = Visibility_validator
LinkMetadata._expires_validator = bv.Nullable(common.DropboxTimestamp_validator)
LinkMetadata._field_names_ = set([
'url',
'visibility',
'expires',
])
LinkMetadata._all_field_names_ = LinkMetadata._field_names_
LinkMetadata._fields_ = [
('url', LinkMetadata._url_validator),
('visibility', LinkMetadata._visibility_validator),
('expires', LinkMetadata._expires_validator),
]
LinkMetadata._all_fields_ = LinkMetadata._fields_
LinkMetadata._tag_to_subtype_ = {
(u'path',): PathLinkMetadata_validator,
(u'collection',): CollectionLinkMetadata_validator,
}
LinkMetadata._pytype_to_tag_and_subtype_ = {
PathLinkMetadata: ((u'path',), PathLinkMetadata_validator),
CollectionLinkMetadata: ((u'collection',), CollectionLinkMetadata_validator),
}
LinkMetadata._is_catch_all_ = True
CollectionLinkMetadata._field_names_ = set([])
CollectionLinkMetadata._all_field_names_ = LinkMetadata._all_field_names_.union(CollectionLinkMetadata._field_names_)
CollectionLinkMetadata._fields_ = []
CollectionLinkMetadata._all_fields_ = LinkMetadata._all_fields_ + CollectionLinkMetadata._fields_
CreateSharedLinkArg._path_validator = bv.String()
CreateSharedLinkArg._short_url_validator = bv.Boolean()
CreateSharedLinkArg._pending_upload_validator = bv.Nullable(PendingUploadMode_validator)
CreateSharedLinkArg._all_field_names_ = set([
'path',
'short_url',
'pending_upload',
])
CreateSharedLinkArg._all_fields_ = [
('path', CreateSharedLinkArg._path_validator),
('short_url', CreateSharedLinkArg._short_url_validator),
('pending_upload', CreateSharedLinkArg._pending_upload_validator),
]
CreateSharedLinkError._path_validator = files.LookupError_validator
CreateSharedLinkError._other_validator = bv.Void()
CreateSharedLinkError._tagmap = {
'path': CreateSharedLinkError._path_validator,
'other': CreateSharedLinkError._other_validator,
}
CreateSharedLinkError.other = CreateSharedLinkError('other')
CreateSharedLinkWithSettingsArg._path_validator = ReadPath_validator
CreateSharedLinkWithSettingsArg._settings_validator = bv.Nullable(SharedLinkSettings_validator)
CreateSharedLinkWithSettingsArg._all_field_names_ = set([
'path',
'settings',
])
CreateSharedLinkWithSettingsArg._all_fields_ = [
('path', CreateSharedLinkWithSettingsArg._path_validator),
('settings', CreateSharedLinkWithSettingsArg._settings_validator),
]
CreateSharedLinkWithSettingsError._path_validator = files.LookupError_validator
CreateSharedLinkWithSettingsError._email_not_verified_validator = bv.Void()
2019-08-28 21:48:24 +02:00
CreateSharedLinkWithSettingsError._shared_link_already_exists_validator = bv.Nullable(SharedLinkAlreadyExistsMetadata_validator)
CreateSharedLinkWithSettingsError._settings_error_validator = SharedLinkSettingsError_validator
CreateSharedLinkWithSettingsError._access_denied_validator = bv.Void()
CreateSharedLinkWithSettingsError._tagmap = {
'path': CreateSharedLinkWithSettingsError._path_validator,
'email_not_verified': CreateSharedLinkWithSettingsError._email_not_verified_validator,
'shared_link_already_exists': CreateSharedLinkWithSettingsError._shared_link_already_exists_validator,
'settings_error': CreateSharedLinkWithSettingsError._settings_error_validator,
'access_denied': CreateSharedLinkWithSettingsError._access_denied_validator,
}
CreateSharedLinkWithSettingsError.email_not_verified = CreateSharedLinkWithSettingsError('email_not_verified')
CreateSharedLinkWithSettingsError.access_denied = CreateSharedLinkWithSettingsError('access_denied')
SharedContentLinkMetadataBase._access_level_validator = bv.Nullable(AccessLevel_validator)
SharedContentLinkMetadataBase._audience_options_validator = bv.List(LinkAudience_validator)
SharedContentLinkMetadataBase._audience_restricting_shared_folder_validator = bv.Nullable(AudienceRestrictingSharedFolder_validator)
SharedContentLinkMetadataBase._current_audience_validator = LinkAudience_validator
SharedContentLinkMetadataBase._expiry_validator = bv.Nullable(common.DropboxTimestamp_validator)
SharedContentLinkMetadataBase._link_permissions_validator = bv.List(LinkPermission_validator)
SharedContentLinkMetadataBase._password_protected_validator = bv.Boolean()
SharedContentLinkMetadataBase._all_field_names_ = set([
'access_level',
'audience_options',
'audience_restricting_shared_folder',
'current_audience',
'expiry',
'link_permissions',
'password_protected',
])
SharedContentLinkMetadataBase._all_fields_ = [
('access_level', SharedContentLinkMetadataBase._access_level_validator),
('audience_options', SharedContentLinkMetadataBase._audience_options_validator),
('audience_restricting_shared_folder', SharedContentLinkMetadataBase._audience_restricting_shared_folder_validator),
('current_audience', SharedContentLinkMetadataBase._current_audience_validator),
('expiry', SharedContentLinkMetadataBase._expiry_validator),
('link_permissions', SharedContentLinkMetadataBase._link_permissions_validator),
('password_protected', SharedContentLinkMetadataBase._password_protected_validator),
]
ExpectedSharedContentLinkMetadata._all_field_names_ = SharedContentLinkMetadataBase._all_field_names_.union(set([]))
ExpectedSharedContentLinkMetadata._all_fields_ = SharedContentLinkMetadataBase._all_fields_ + []
FileAction._disable_viewer_info_validator = bv.Void()
FileAction._edit_contents_validator = bv.Void()
FileAction._enable_viewer_info_validator = bv.Void()
FileAction._invite_viewer_validator = bv.Void()
FileAction._invite_viewer_no_comment_validator = bv.Void()
2019-08-28 21:48:24 +02:00
FileAction._invite_editor_validator = bv.Void()
FileAction._unshare_validator = bv.Void()
FileAction._relinquish_membership_validator = bv.Void()
FileAction._share_link_validator = bv.Void()
FileAction._create_link_validator = bv.Void()
2019-08-28 21:48:24 +02:00
FileAction._create_view_link_validator = bv.Void()
FileAction._create_edit_link_validator = bv.Void()
FileAction._other_validator = bv.Void()
FileAction._tagmap = {
'disable_viewer_info': FileAction._disable_viewer_info_validator,
'edit_contents': FileAction._edit_contents_validator,
'enable_viewer_info': FileAction._enable_viewer_info_validator,
'invite_viewer': FileAction._invite_viewer_validator,
'invite_viewer_no_comment': FileAction._invite_viewer_no_comment_validator,
2019-08-28 21:48:24 +02:00
'invite_editor': FileAction._invite_editor_validator,
'unshare': FileAction._unshare_validator,
'relinquish_membership': FileAction._relinquish_membership_validator,
'share_link': FileAction._share_link_validator,
'create_link': FileAction._create_link_validator,
2019-08-28 21:48:24 +02:00
'create_view_link': FileAction._create_view_link_validator,
'create_edit_link': FileAction._create_edit_link_validator,
'other': FileAction._other_validator,
}
FileAction.disable_viewer_info = FileAction('disable_viewer_info')
FileAction.edit_contents = FileAction('edit_contents')
FileAction.enable_viewer_info = FileAction('enable_viewer_info')
FileAction.invite_viewer = FileAction('invite_viewer')
FileAction.invite_viewer_no_comment = FileAction('invite_viewer_no_comment')
2019-08-28 21:48:24 +02:00
FileAction.invite_editor = FileAction('invite_editor')
FileAction.unshare = FileAction('unshare')
FileAction.relinquish_membership = FileAction('relinquish_membership')
FileAction.share_link = FileAction('share_link')
FileAction.create_link = FileAction('create_link')
2019-08-28 21:48:24 +02:00
FileAction.create_view_link = FileAction('create_view_link')
FileAction.create_edit_link = FileAction('create_edit_link')
FileAction.other = FileAction('other')
FileErrorResult._file_not_found_error_validator = files.Id_validator
FileErrorResult._invalid_file_action_error_validator = files.Id_validator
FileErrorResult._permission_denied_error_validator = files.Id_validator
FileErrorResult._other_validator = bv.Void()
FileErrorResult._tagmap = {
'file_not_found_error': FileErrorResult._file_not_found_error_validator,
'invalid_file_action_error': FileErrorResult._invalid_file_action_error_validator,
'permission_denied_error': FileErrorResult._permission_denied_error_validator,
'other': FileErrorResult._other_validator,
}
FileErrorResult.other = FileErrorResult('other')
SharedLinkMetadata._url_validator = bv.String()
SharedLinkMetadata._id_validator = bv.Nullable(Id_validator)
SharedLinkMetadata._name_validator = bv.String()
SharedLinkMetadata._expires_validator = bv.Nullable(common.DropboxTimestamp_validator)
SharedLinkMetadata._path_lower_validator = bv.Nullable(bv.String())
SharedLinkMetadata._link_permissions_validator = LinkPermissions_validator
SharedLinkMetadata._team_member_info_validator = bv.Nullable(TeamMemberInfo_validator)
SharedLinkMetadata._content_owner_team_info_validator = bv.Nullable(TeamInfo_validator)
SharedLinkMetadata._field_names_ = set([
'url',
'id',
'name',
'expires',
'path_lower',
'link_permissions',
'team_member_info',
'content_owner_team_info',
])
SharedLinkMetadata._all_field_names_ = SharedLinkMetadata._field_names_
SharedLinkMetadata._fields_ = [
('url', SharedLinkMetadata._url_validator),
('id', SharedLinkMetadata._id_validator),
('name', SharedLinkMetadata._name_validator),
('expires', SharedLinkMetadata._expires_validator),
('path_lower', SharedLinkMetadata._path_lower_validator),
('link_permissions', SharedLinkMetadata._link_permissions_validator),
('team_member_info', SharedLinkMetadata._team_member_info_validator),
('content_owner_team_info', SharedLinkMetadata._content_owner_team_info_validator),
]
SharedLinkMetadata._all_fields_ = SharedLinkMetadata._fields_
SharedLinkMetadata._tag_to_subtype_ = {
(u'file',): FileLinkMetadata_validator,
(u'folder',): FolderLinkMetadata_validator,
}
SharedLinkMetadata._pytype_to_tag_and_subtype_ = {
FileLinkMetadata: ((u'file',), FileLinkMetadata_validator),
FolderLinkMetadata: ((u'folder',), FolderLinkMetadata_validator),
}
SharedLinkMetadata._is_catch_all_ = True
FileLinkMetadata._client_modified_validator = common.DropboxTimestamp_validator
FileLinkMetadata._server_modified_validator = common.DropboxTimestamp_validator
FileLinkMetadata._rev_validator = Rev_validator
FileLinkMetadata._size_validator = bv.UInt64()
FileLinkMetadata._field_names_ = set([
'client_modified',
'server_modified',
'rev',
'size',
])
FileLinkMetadata._all_field_names_ = SharedLinkMetadata._all_field_names_.union(FileLinkMetadata._field_names_)
FileLinkMetadata._fields_ = [
('client_modified', FileLinkMetadata._client_modified_validator),
('server_modified', FileLinkMetadata._server_modified_validator),
('rev', FileLinkMetadata._rev_validator),
('size', FileLinkMetadata._size_validator),
]
FileLinkMetadata._all_fields_ = SharedLinkMetadata._all_fields_ + FileLinkMetadata._fields_
FileMemberActionError._invalid_member_validator = bv.Void()
FileMemberActionError._no_permission_validator = bv.Void()
FileMemberActionError._access_error_validator = SharingFileAccessError_validator
FileMemberActionError._no_explicit_access_validator = MemberAccessLevelResult_validator
FileMemberActionError._other_validator = bv.Void()
FileMemberActionError._tagmap = {
'invalid_member': FileMemberActionError._invalid_member_validator,
'no_permission': FileMemberActionError._no_permission_validator,
'access_error': FileMemberActionError._access_error_validator,
'no_explicit_access': FileMemberActionError._no_explicit_access_validator,
'other': FileMemberActionError._other_validator,
}
FileMemberActionError.invalid_member = FileMemberActionError('invalid_member')
FileMemberActionError.no_permission = FileMemberActionError('no_permission')
FileMemberActionError.other = FileMemberActionError('other')
FileMemberActionIndividualResult._success_validator = bv.Nullable(AccessLevel_validator)
FileMemberActionIndividualResult._member_error_validator = FileMemberActionError_validator
FileMemberActionIndividualResult._tagmap = {
'success': FileMemberActionIndividualResult._success_validator,
'member_error': FileMemberActionIndividualResult._member_error_validator,
}
FileMemberActionResult._member_validator = MemberSelector_validator
FileMemberActionResult._result_validator = FileMemberActionIndividualResult_validator
FileMemberActionResult._all_field_names_ = set([
'member',
'result',
])
FileMemberActionResult._all_fields_ = [
('member', FileMemberActionResult._member_validator),
('result', FileMemberActionResult._result_validator),
]
FileMemberRemoveActionResult._success_validator = MemberAccessLevelResult_validator
FileMemberRemoveActionResult._member_error_validator = FileMemberActionError_validator
FileMemberRemoveActionResult._other_validator = bv.Void()
FileMemberRemoveActionResult._tagmap = {
'success': FileMemberRemoveActionResult._success_validator,
'member_error': FileMemberRemoveActionResult._member_error_validator,
'other': FileMemberRemoveActionResult._other_validator,
}
FileMemberRemoveActionResult.other = FileMemberRemoveActionResult('other')
FilePermission._action_validator = FileAction_validator
FilePermission._allow_validator = bv.Boolean()
FilePermission._reason_validator = bv.Nullable(PermissionDeniedReason_validator)
FilePermission._all_field_names_ = set([
'action',
'allow',
'reason',
])
FilePermission._all_fields_ = [
('action', FilePermission._action_validator),
('allow', FilePermission._allow_validator),
('reason', FilePermission._reason_validator),
]
FolderAction._change_options_validator = bv.Void()
FolderAction._disable_viewer_info_validator = bv.Void()
FolderAction._edit_contents_validator = bv.Void()
FolderAction._enable_viewer_info_validator = bv.Void()
FolderAction._invite_editor_validator = bv.Void()
FolderAction._invite_viewer_validator = bv.Void()
FolderAction._invite_viewer_no_comment_validator = bv.Void()
FolderAction._relinquish_membership_validator = bv.Void()
FolderAction._unmount_validator = bv.Void()
FolderAction._unshare_validator = bv.Void()
FolderAction._leave_a_copy_validator = bv.Void()
FolderAction._share_link_validator = bv.Void()
FolderAction._create_link_validator = bv.Void()
2019-08-28 21:48:24 +02:00
FolderAction._set_access_inheritance_validator = bv.Void()
FolderAction._other_validator = bv.Void()
FolderAction._tagmap = {
'change_options': FolderAction._change_options_validator,
'disable_viewer_info': FolderAction._disable_viewer_info_validator,
'edit_contents': FolderAction._edit_contents_validator,
'enable_viewer_info': FolderAction._enable_viewer_info_validator,
'invite_editor': FolderAction._invite_editor_validator,
'invite_viewer': FolderAction._invite_viewer_validator,
'invite_viewer_no_comment': FolderAction._invite_viewer_no_comment_validator,
'relinquish_membership': FolderAction._relinquish_membership_validator,
'unmount': FolderAction._unmount_validator,
'unshare': FolderAction._unshare_validator,
'leave_a_copy': FolderAction._leave_a_copy_validator,
'share_link': FolderAction._share_link_validator,
'create_link': FolderAction._create_link_validator,
2019-08-28 21:48:24 +02:00
'set_access_inheritance': FolderAction._set_access_inheritance_validator,
'other': FolderAction._other_validator,
}
FolderAction.change_options = FolderAction('change_options')
FolderAction.disable_viewer_info = FolderAction('disable_viewer_info')
FolderAction.edit_contents = FolderAction('edit_contents')
FolderAction.enable_viewer_info = FolderAction('enable_viewer_info')
FolderAction.invite_editor = FolderAction('invite_editor')
FolderAction.invite_viewer = FolderAction('invite_viewer')
FolderAction.invite_viewer_no_comment = FolderAction('invite_viewer_no_comment')
FolderAction.relinquish_membership = FolderAction('relinquish_membership')
FolderAction.unmount = FolderAction('unmount')
FolderAction.unshare = FolderAction('unshare')
FolderAction.leave_a_copy = FolderAction('leave_a_copy')
FolderAction.share_link = FolderAction('share_link')
FolderAction.create_link = FolderAction('create_link')
2019-08-28 21:48:24 +02:00
FolderAction.set_access_inheritance = FolderAction('set_access_inheritance')
FolderAction.other = FolderAction('other')
FolderLinkMetadata._field_names_ = set([])
FolderLinkMetadata._all_field_names_ = SharedLinkMetadata._all_field_names_.union(FolderLinkMetadata._field_names_)
FolderLinkMetadata._fields_ = []
FolderLinkMetadata._all_fields_ = SharedLinkMetadata._all_fields_ + FolderLinkMetadata._fields_
FolderPermission._action_validator = FolderAction_validator
FolderPermission._allow_validator = bv.Boolean()
FolderPermission._reason_validator = bv.Nullable(PermissionDeniedReason_validator)
FolderPermission._all_field_names_ = set([
'action',
'allow',
'reason',
])
FolderPermission._all_fields_ = [
('action', FolderPermission._action_validator),
('allow', FolderPermission._allow_validator),
('reason', FolderPermission._reason_validator),
]
FolderPolicy._member_policy_validator = bv.Nullable(MemberPolicy_validator)
FolderPolicy._resolved_member_policy_validator = bv.Nullable(MemberPolicy_validator)
FolderPolicy._acl_update_policy_validator = AclUpdatePolicy_validator
FolderPolicy._shared_link_policy_validator = SharedLinkPolicy_validator
FolderPolicy._viewer_info_policy_validator = bv.Nullable(ViewerInfoPolicy_validator)
FolderPolicy._all_field_names_ = set([
'member_policy',
'resolved_member_policy',
'acl_update_policy',
'shared_link_policy',
'viewer_info_policy',
])
FolderPolicy._all_fields_ = [
('member_policy', FolderPolicy._member_policy_validator),
('resolved_member_policy', FolderPolicy._resolved_member_policy_validator),
('acl_update_policy', FolderPolicy._acl_update_policy_validator),
('shared_link_policy', FolderPolicy._shared_link_policy_validator),
('viewer_info_policy', FolderPolicy._viewer_info_policy_validator),
]
GetFileMetadataArg._file_validator = PathOrId_validator
GetFileMetadataArg._actions_validator = bv.Nullable(bv.List(FileAction_validator))
GetFileMetadataArg._all_field_names_ = set([
'file',
'actions',
])
GetFileMetadataArg._all_fields_ = [
('file', GetFileMetadataArg._file_validator),
('actions', GetFileMetadataArg._actions_validator),
]
GetFileMetadataBatchArg._files_validator = bv.List(PathOrId_validator, max_items=100)
GetFileMetadataBatchArg._actions_validator = bv.Nullable(bv.List(FileAction_validator))
GetFileMetadataBatchArg._all_field_names_ = set([
'files',
'actions',
])
GetFileMetadataBatchArg._all_fields_ = [
('files', GetFileMetadataBatchArg._files_validator),
('actions', GetFileMetadataBatchArg._actions_validator),
]
GetFileMetadataBatchResult._file_validator = PathOrId_validator
GetFileMetadataBatchResult._result_validator = GetFileMetadataIndividualResult_validator
GetFileMetadataBatchResult._all_field_names_ = set([
'file',
'result',
])
GetFileMetadataBatchResult._all_fields_ = [
('file', GetFileMetadataBatchResult._file_validator),
('result', GetFileMetadataBatchResult._result_validator),
]
GetFileMetadataError._user_error_validator = SharingUserError_validator
GetFileMetadataError._access_error_validator = SharingFileAccessError_validator
GetFileMetadataError._other_validator = bv.Void()
GetFileMetadataError._tagmap = {
'user_error': GetFileMetadataError._user_error_validator,
'access_error': GetFileMetadataError._access_error_validator,
'other': GetFileMetadataError._other_validator,
}
GetFileMetadataError.other = GetFileMetadataError('other')
GetFileMetadataIndividualResult._metadata_validator = SharedFileMetadata_validator
GetFileMetadataIndividualResult._access_error_validator = SharingFileAccessError_validator
GetFileMetadataIndividualResult._other_validator = bv.Void()
GetFileMetadataIndividualResult._tagmap = {
'metadata': GetFileMetadataIndividualResult._metadata_validator,
'access_error': GetFileMetadataIndividualResult._access_error_validator,
'other': GetFileMetadataIndividualResult._other_validator,
}
GetFileMetadataIndividualResult.other = GetFileMetadataIndividualResult('other')
GetMetadataArgs._shared_folder_id_validator = common.SharedFolderId_validator
GetMetadataArgs._actions_validator = bv.Nullable(bv.List(FolderAction_validator))
GetMetadataArgs._all_field_names_ = set([
'shared_folder_id',
'actions',
])
GetMetadataArgs._all_fields_ = [
('shared_folder_id', GetMetadataArgs._shared_folder_id_validator),
('actions', GetMetadataArgs._actions_validator),
]
SharedLinkError._shared_link_not_found_validator = bv.Void()
SharedLinkError._shared_link_access_denied_validator = bv.Void()
SharedLinkError._unsupported_link_type_validator = bv.Void()
SharedLinkError._other_validator = bv.Void()
SharedLinkError._tagmap = {
'shared_link_not_found': SharedLinkError._shared_link_not_found_validator,
'shared_link_access_denied': SharedLinkError._shared_link_access_denied_validator,
'unsupported_link_type': SharedLinkError._unsupported_link_type_validator,
'other': SharedLinkError._other_validator,
}
SharedLinkError.shared_link_not_found = SharedLinkError('shared_link_not_found')
SharedLinkError.shared_link_access_denied = SharedLinkError('shared_link_access_denied')
SharedLinkError.unsupported_link_type = SharedLinkError('unsupported_link_type')
SharedLinkError.other = SharedLinkError('other')
GetSharedLinkFileError._shared_link_is_directory_validator = bv.Void()
GetSharedLinkFileError._tagmap = {
'shared_link_is_directory': GetSharedLinkFileError._shared_link_is_directory_validator,
}
GetSharedLinkFileError._tagmap.update(SharedLinkError._tagmap)
GetSharedLinkFileError.shared_link_is_directory = GetSharedLinkFileError('shared_link_is_directory')
GetSharedLinkMetadataArg._url_validator = bv.String()
GetSharedLinkMetadataArg._path_validator = bv.Nullable(Path_validator)
GetSharedLinkMetadataArg._link_password_validator = bv.Nullable(bv.String())
GetSharedLinkMetadataArg._all_field_names_ = set([
'url',
'path',
'link_password',
])
GetSharedLinkMetadataArg._all_fields_ = [
('url', GetSharedLinkMetadataArg._url_validator),
('path', GetSharedLinkMetadataArg._path_validator),
('link_password', GetSharedLinkMetadataArg._link_password_validator),
]
GetSharedLinksArg._path_validator = bv.Nullable(bv.String())
GetSharedLinksArg._all_field_names_ = set(['path'])
GetSharedLinksArg._all_fields_ = [('path', GetSharedLinksArg._path_validator)]
GetSharedLinksError._path_validator = files.MalformedPathError_validator
GetSharedLinksError._other_validator = bv.Void()
GetSharedLinksError._tagmap = {
'path': GetSharedLinksError._path_validator,
'other': GetSharedLinksError._other_validator,
}
GetSharedLinksError.other = GetSharedLinksError('other')
GetSharedLinksResult._links_validator = bv.List(LinkMetadata_validator)
GetSharedLinksResult._all_field_names_ = set(['links'])
GetSharedLinksResult._all_fields_ = [('links', GetSharedLinksResult._links_validator)]
GroupInfo._group_type_validator = team_common.GroupType_validator
GroupInfo._is_member_validator = bv.Boolean()
GroupInfo._is_owner_validator = bv.Boolean()
GroupInfo._same_team_validator = bv.Boolean()
GroupInfo._all_field_names_ = team_common.GroupSummary._all_field_names_.union(set([
'group_type',
'is_member',
'is_owner',
'same_team',
]))
GroupInfo._all_fields_ = team_common.GroupSummary._all_fields_ + [
('group_type', GroupInfo._group_type_validator),
('is_member', GroupInfo._is_member_validator),
('is_owner', GroupInfo._is_owner_validator),
('same_team', GroupInfo._same_team_validator),
]
MembershipInfo._access_type_validator = AccessLevel_validator
MembershipInfo._permissions_validator = bv.Nullable(bv.List(MemberPermission_validator))
MembershipInfo._initials_validator = bv.Nullable(bv.String())
MembershipInfo._is_inherited_validator = bv.Boolean()
MembershipInfo._all_field_names_ = set([
'access_type',
'permissions',
'initials',
'is_inherited',
])
MembershipInfo._all_fields_ = [
('access_type', MembershipInfo._access_type_validator),
('permissions', MembershipInfo._permissions_validator),
('initials', MembershipInfo._initials_validator),
('is_inherited', MembershipInfo._is_inherited_validator),
]
GroupMembershipInfo._group_validator = GroupInfo_validator
GroupMembershipInfo._all_field_names_ = MembershipInfo._all_field_names_.union(set(['group']))
GroupMembershipInfo._all_fields_ = MembershipInfo._all_fields_ + [('group', GroupMembershipInfo._group_validator)]
InsufficientPlan._message_validator = bv.String()
InsufficientPlan._upsell_url_validator = bv.Nullable(bv.String())
InsufficientPlan._all_field_names_ = set([
'message',
'upsell_url',
])
InsufficientPlan._all_fields_ = [
('message', InsufficientPlan._message_validator),
('upsell_url', InsufficientPlan._upsell_url_validator),
]
InsufficientQuotaAmounts._space_needed_validator = bv.UInt64()
InsufficientQuotaAmounts._space_shortage_validator = bv.UInt64()
InsufficientQuotaAmounts._space_left_validator = bv.UInt64()
InsufficientQuotaAmounts._all_field_names_ = set([
'space_needed',
'space_shortage',
'space_left',
])
InsufficientQuotaAmounts._all_fields_ = [
('space_needed', InsufficientQuotaAmounts._space_needed_validator),
('space_shortage', InsufficientQuotaAmounts._space_shortage_validator),
('space_left', InsufficientQuotaAmounts._space_left_validator),
]
InviteeInfo._email_validator = common.EmailAddress_validator
InviteeInfo._other_validator = bv.Void()
InviteeInfo._tagmap = {
'email': InviteeInfo._email_validator,
'other': InviteeInfo._other_validator,
}
InviteeInfo.other = InviteeInfo('other')
InviteeMembershipInfo._invitee_validator = InviteeInfo_validator
InviteeMembershipInfo._user_validator = bv.Nullable(UserInfo_validator)
InviteeMembershipInfo._all_field_names_ = MembershipInfo._all_field_names_.union(set([
'invitee',
'user',
]))
InviteeMembershipInfo._all_fields_ = MembershipInfo._all_fields_ + [
('invitee', InviteeMembershipInfo._invitee_validator),
('user', InviteeMembershipInfo._user_validator),
]
JobError._unshare_folder_error_validator = UnshareFolderError_validator
JobError._remove_folder_member_error_validator = RemoveFolderMemberError_validator
JobError._relinquish_folder_membership_error_validator = RelinquishFolderMembershipError_validator
JobError._other_validator = bv.Void()
JobError._tagmap = {
'unshare_folder_error': JobError._unshare_folder_error_validator,
'remove_folder_member_error': JobError._remove_folder_member_error_validator,
'relinquish_folder_membership_error': JobError._relinquish_folder_membership_error_validator,
'other': JobError._other_validator,
}
JobError.other = JobError('other')
JobStatus._complete_validator = bv.Void()
JobStatus._failed_validator = JobError_validator
JobStatus._tagmap = {
'complete': JobStatus._complete_validator,
'failed': JobStatus._failed_validator,
}
2019-08-28 21:48:24 +02:00
JobStatus._tagmap.update(async_.PollResultBase._tagmap)
JobStatus.complete = JobStatus('complete')
2019-08-28 21:48:24 +02:00
LinkAccessLevel._viewer_validator = bv.Void()
LinkAccessLevel._editor_validator = bv.Void()
LinkAccessLevel._other_validator = bv.Void()
LinkAccessLevel._tagmap = {
'viewer': LinkAccessLevel._viewer_validator,
'editor': LinkAccessLevel._editor_validator,
'other': LinkAccessLevel._other_validator,
}
LinkAccessLevel.viewer = LinkAccessLevel('viewer')
LinkAccessLevel.editor = LinkAccessLevel('editor')
LinkAccessLevel.other = LinkAccessLevel('other')
LinkAction._change_access_level_validator = bv.Void()
LinkAction._change_audience_validator = bv.Void()
LinkAction._remove_expiry_validator = bv.Void()
LinkAction._remove_password_validator = bv.Void()
LinkAction._set_expiry_validator = bv.Void()
LinkAction._set_password_validator = bv.Void()
LinkAction._other_validator = bv.Void()
LinkAction._tagmap = {
'change_access_level': LinkAction._change_access_level_validator,
'change_audience': LinkAction._change_audience_validator,
'remove_expiry': LinkAction._remove_expiry_validator,
'remove_password': LinkAction._remove_password_validator,
'set_expiry': LinkAction._set_expiry_validator,
'set_password': LinkAction._set_password_validator,
'other': LinkAction._other_validator,
}
LinkAction.change_access_level = LinkAction('change_access_level')
LinkAction.change_audience = LinkAction('change_audience')
LinkAction.remove_expiry = LinkAction('remove_expiry')
LinkAction.remove_password = LinkAction('remove_password')
LinkAction.set_expiry = LinkAction('set_expiry')
LinkAction.set_password = LinkAction('set_password')
LinkAction.other = LinkAction('other')
LinkAudience._public_validator = bv.Void()
LinkAudience._team_validator = bv.Void()
2019-08-28 21:48:24 +02:00
LinkAudience._no_one_validator = bv.Void()
LinkAudience._password_validator = bv.Void()
LinkAudience._members_validator = bv.Void()
LinkAudience._other_validator = bv.Void()
LinkAudience._tagmap = {
'public': LinkAudience._public_validator,
'team': LinkAudience._team_validator,
2019-08-28 21:48:24 +02:00
'no_one': LinkAudience._no_one_validator,
'password': LinkAudience._password_validator,
'members': LinkAudience._members_validator,
'other': LinkAudience._other_validator,
}
LinkAudience.public = LinkAudience('public')
LinkAudience.team = LinkAudience('team')
2019-08-28 21:48:24 +02:00
LinkAudience.no_one = LinkAudience('no_one')
LinkAudience.password = LinkAudience('password')
LinkAudience.members = LinkAudience('members')
LinkAudience.other = LinkAudience('other')
LinkExpiry._remove_expiry_validator = bv.Void()
LinkExpiry._set_expiry_validator = common.DropboxTimestamp_validator
LinkExpiry._other_validator = bv.Void()
LinkExpiry._tagmap = {
'remove_expiry': LinkExpiry._remove_expiry_validator,
'set_expiry': LinkExpiry._set_expiry_validator,
'other': LinkExpiry._other_validator,
}
LinkExpiry.remove_expiry = LinkExpiry('remove_expiry')
LinkExpiry.other = LinkExpiry('other')
LinkPassword._remove_password_validator = bv.Void()
LinkPassword._set_password_validator = bv.String()
LinkPassword._other_validator = bv.Void()
LinkPassword._tagmap = {
'remove_password': LinkPassword._remove_password_validator,
'set_password': LinkPassword._set_password_validator,
'other': LinkPassword._other_validator,
}
LinkPassword.remove_password = LinkPassword('remove_password')
LinkPassword.other = LinkPassword('other')
LinkPermission._action_validator = LinkAction_validator
LinkPermission._allow_validator = bv.Boolean()
LinkPermission._reason_validator = bv.Nullable(PermissionDeniedReason_validator)
LinkPermission._all_field_names_ = set([
'action',
'allow',
'reason',
])
LinkPermission._all_fields_ = [
('action', LinkPermission._action_validator),
('allow', LinkPermission._allow_validator),
('reason', LinkPermission._reason_validator),
]
LinkPermissions._resolved_visibility_validator = bv.Nullable(ResolvedVisibility_validator)
LinkPermissions._requested_visibility_validator = bv.Nullable(RequestedVisibility_validator)
LinkPermissions._can_revoke_validator = bv.Boolean()
LinkPermissions._revoke_failure_reason_validator = bv.Nullable(SharedLinkAccessFailureReason_validator)
2019-08-28 21:48:24 +02:00
LinkPermissions._effective_audience_validator = bv.Nullable(LinkAudience_validator)
LinkPermissions._link_access_level_validator = bv.Nullable(LinkAccessLevel_validator)
LinkPermissions._all_field_names_ = set([
'resolved_visibility',
'requested_visibility',
'can_revoke',
'revoke_failure_reason',
2019-08-28 21:48:24 +02:00
'effective_audience',
'link_access_level',
])
LinkPermissions._all_fields_ = [
('resolved_visibility', LinkPermissions._resolved_visibility_validator),
('requested_visibility', LinkPermissions._requested_visibility_validator),
('can_revoke', LinkPermissions._can_revoke_validator),
('revoke_failure_reason', LinkPermissions._revoke_failure_reason_validator),
2019-08-28 21:48:24 +02:00
('effective_audience', LinkPermissions._effective_audience_validator),
('link_access_level', LinkPermissions._link_access_level_validator),
]
LinkSettings._access_level_validator = bv.Nullable(AccessLevel_validator)
LinkSettings._audience_validator = bv.Nullable(LinkAudience_validator)
LinkSettings._expiry_validator = bv.Nullable(LinkExpiry_validator)
LinkSettings._password_validator = bv.Nullable(LinkPassword_validator)
LinkSettings._all_field_names_ = set([
'access_level',
'audience',
'expiry',
'password',
])
LinkSettings._all_fields_ = [
('access_level', LinkSettings._access_level_validator),
('audience', LinkSettings._audience_validator),
('expiry', LinkSettings._expiry_validator),
('password', LinkSettings._password_validator),
]
ListFileMembersArg._file_validator = PathOrId_validator
ListFileMembersArg._actions_validator = bv.Nullable(bv.List(MemberAction_validator))
ListFileMembersArg._include_inherited_validator = bv.Boolean()
ListFileMembersArg._limit_validator = bv.UInt32(min_value=1, max_value=300)
ListFileMembersArg._all_field_names_ = set([
'file',
'actions',
'include_inherited',
'limit',
])
ListFileMembersArg._all_fields_ = [
('file', ListFileMembersArg._file_validator),
('actions', ListFileMembersArg._actions_validator),
('include_inherited', ListFileMembersArg._include_inherited_validator),
('limit', ListFileMembersArg._limit_validator),
]
ListFileMembersBatchArg._files_validator = bv.List(PathOrId_validator, max_items=100)
ListFileMembersBatchArg._limit_validator = bv.UInt32(max_value=20)
ListFileMembersBatchArg._all_field_names_ = set([
'files',
'limit',
])
ListFileMembersBatchArg._all_fields_ = [
('files', ListFileMembersBatchArg._files_validator),
('limit', ListFileMembersBatchArg._limit_validator),
]
ListFileMembersBatchResult._file_validator = PathOrId_validator
ListFileMembersBatchResult._result_validator = ListFileMembersIndividualResult_validator
ListFileMembersBatchResult._all_field_names_ = set([
'file',
'result',
])
ListFileMembersBatchResult._all_fields_ = [
('file', ListFileMembersBatchResult._file_validator),
('result', ListFileMembersBatchResult._result_validator),
]
ListFileMembersContinueArg._cursor_validator = bv.String()
ListFileMembersContinueArg._all_field_names_ = set(['cursor'])
ListFileMembersContinueArg._all_fields_ = [('cursor', ListFileMembersContinueArg._cursor_validator)]
ListFileMembersContinueError._user_error_validator = SharingUserError_validator
ListFileMembersContinueError._access_error_validator = SharingFileAccessError_validator
ListFileMembersContinueError._invalid_cursor_validator = bv.Void()
ListFileMembersContinueError._other_validator = bv.Void()
ListFileMembersContinueError._tagmap = {
'user_error': ListFileMembersContinueError._user_error_validator,
'access_error': ListFileMembersContinueError._access_error_validator,
'invalid_cursor': ListFileMembersContinueError._invalid_cursor_validator,
'other': ListFileMembersContinueError._other_validator,
}
ListFileMembersContinueError.invalid_cursor = ListFileMembersContinueError('invalid_cursor')
ListFileMembersContinueError.other = ListFileMembersContinueError('other')
ListFileMembersCountResult._members_validator = SharedFileMembers_validator
ListFileMembersCountResult._member_count_validator = bv.UInt32()
ListFileMembersCountResult._all_field_names_ = set([
'members',
'member_count',
])
ListFileMembersCountResult._all_fields_ = [
('members', ListFileMembersCountResult._members_validator),
('member_count', ListFileMembersCountResult._member_count_validator),
]
ListFileMembersError._user_error_validator = SharingUserError_validator
ListFileMembersError._access_error_validator = SharingFileAccessError_validator
ListFileMembersError._other_validator = bv.Void()
ListFileMembersError._tagmap = {
'user_error': ListFileMembersError._user_error_validator,
'access_error': ListFileMembersError._access_error_validator,
'other': ListFileMembersError._other_validator,
}
ListFileMembersError.other = ListFileMembersError('other')
ListFileMembersIndividualResult._result_validator = ListFileMembersCountResult_validator
ListFileMembersIndividualResult._access_error_validator = SharingFileAccessError_validator
ListFileMembersIndividualResult._other_validator = bv.Void()
ListFileMembersIndividualResult._tagmap = {
'result': ListFileMembersIndividualResult._result_validator,
'access_error': ListFileMembersIndividualResult._access_error_validator,
'other': ListFileMembersIndividualResult._other_validator,
}
ListFileMembersIndividualResult.other = ListFileMembersIndividualResult('other')
ListFilesArg._limit_validator = bv.UInt32(min_value=1, max_value=300)
ListFilesArg._actions_validator = bv.Nullable(bv.List(FileAction_validator))
ListFilesArg._all_field_names_ = set([
'limit',
'actions',
])
ListFilesArg._all_fields_ = [
('limit', ListFilesArg._limit_validator),
('actions', ListFilesArg._actions_validator),
]
ListFilesContinueArg._cursor_validator = bv.String()
ListFilesContinueArg._all_field_names_ = set(['cursor'])
ListFilesContinueArg._all_fields_ = [('cursor', ListFilesContinueArg._cursor_validator)]
ListFilesContinueError._user_error_validator = SharingUserError_validator
ListFilesContinueError._invalid_cursor_validator = bv.Void()
ListFilesContinueError._other_validator = bv.Void()
ListFilesContinueError._tagmap = {
'user_error': ListFilesContinueError._user_error_validator,
'invalid_cursor': ListFilesContinueError._invalid_cursor_validator,
'other': ListFilesContinueError._other_validator,
}
ListFilesContinueError.invalid_cursor = ListFilesContinueError('invalid_cursor')
ListFilesContinueError.other = ListFilesContinueError('other')
ListFilesResult._entries_validator = bv.List(SharedFileMetadata_validator)
ListFilesResult._cursor_validator = bv.Nullable(bv.String())
ListFilesResult._all_field_names_ = set([
'entries',
'cursor',
])
ListFilesResult._all_fields_ = [
('entries', ListFilesResult._entries_validator),
('cursor', ListFilesResult._cursor_validator),
]
ListFolderMembersCursorArg._actions_validator = bv.Nullable(bv.List(MemberAction_validator))
ListFolderMembersCursorArg._limit_validator = bv.UInt32(min_value=1, max_value=1000)
ListFolderMembersCursorArg._all_field_names_ = set([
'actions',
'limit',
])
ListFolderMembersCursorArg._all_fields_ = [
('actions', ListFolderMembersCursorArg._actions_validator),
('limit', ListFolderMembersCursorArg._limit_validator),
]
ListFolderMembersArgs._shared_folder_id_validator = common.SharedFolderId_validator
ListFolderMembersArgs._all_field_names_ = ListFolderMembersCursorArg._all_field_names_.union(set(['shared_folder_id']))
ListFolderMembersArgs._all_fields_ = ListFolderMembersCursorArg._all_fields_ + [('shared_folder_id', ListFolderMembersArgs._shared_folder_id_validator)]
ListFolderMembersContinueArg._cursor_validator = bv.String()
ListFolderMembersContinueArg._all_field_names_ = set(['cursor'])
ListFolderMembersContinueArg._all_fields_ = [('cursor', ListFolderMembersContinueArg._cursor_validator)]
ListFolderMembersContinueError._access_error_validator = SharedFolderAccessError_validator
ListFolderMembersContinueError._invalid_cursor_validator = bv.Void()
ListFolderMembersContinueError._other_validator = bv.Void()
ListFolderMembersContinueError._tagmap = {
'access_error': ListFolderMembersContinueError._access_error_validator,
'invalid_cursor': ListFolderMembersContinueError._invalid_cursor_validator,
'other': ListFolderMembersContinueError._other_validator,
}
ListFolderMembersContinueError.invalid_cursor = ListFolderMembersContinueError('invalid_cursor')
ListFolderMembersContinueError.other = ListFolderMembersContinueError('other')
ListFoldersArgs._limit_validator = bv.UInt32(min_value=1, max_value=1000)
ListFoldersArgs._actions_validator = bv.Nullable(bv.List(FolderAction_validator))
ListFoldersArgs._all_field_names_ = set([
'limit',
'actions',
])
ListFoldersArgs._all_fields_ = [
('limit', ListFoldersArgs._limit_validator),
('actions', ListFoldersArgs._actions_validator),
]
ListFoldersContinueArg._cursor_validator = bv.String()
ListFoldersContinueArg._all_field_names_ = set(['cursor'])
ListFoldersContinueArg._all_fields_ = [('cursor', ListFoldersContinueArg._cursor_validator)]
ListFoldersContinueError._invalid_cursor_validator = bv.Void()
ListFoldersContinueError._other_validator = bv.Void()
ListFoldersContinueError._tagmap = {
'invalid_cursor': ListFoldersContinueError._invalid_cursor_validator,
'other': ListFoldersContinueError._other_validator,
}
ListFoldersContinueError.invalid_cursor = ListFoldersContinueError('invalid_cursor')
ListFoldersContinueError.other = ListFoldersContinueError('other')
ListFoldersResult._entries_validator = bv.List(SharedFolderMetadata_validator)
ListFoldersResult._cursor_validator = bv.Nullable(bv.String())
ListFoldersResult._all_field_names_ = set([
'entries',
'cursor',
])
ListFoldersResult._all_fields_ = [
('entries', ListFoldersResult._entries_validator),
('cursor', ListFoldersResult._cursor_validator),
]
ListSharedLinksArg._path_validator = bv.Nullable(ReadPath_validator)
ListSharedLinksArg._cursor_validator = bv.Nullable(bv.String())
ListSharedLinksArg._direct_only_validator = bv.Nullable(bv.Boolean())
ListSharedLinksArg._all_field_names_ = set([
'path',
'cursor',
'direct_only',
])
ListSharedLinksArg._all_fields_ = [
('path', ListSharedLinksArg._path_validator),
('cursor', ListSharedLinksArg._cursor_validator),
('direct_only', ListSharedLinksArg._direct_only_validator),
]
ListSharedLinksError._path_validator = files.LookupError_validator
ListSharedLinksError._reset_validator = bv.Void()
ListSharedLinksError._other_validator = bv.Void()
ListSharedLinksError._tagmap = {
'path': ListSharedLinksError._path_validator,
'reset': ListSharedLinksError._reset_validator,
'other': ListSharedLinksError._other_validator,
}
ListSharedLinksError.reset = ListSharedLinksError('reset')
ListSharedLinksError.other = ListSharedLinksError('other')
ListSharedLinksResult._links_validator = bv.List(SharedLinkMetadata_validator)
ListSharedLinksResult._has_more_validator = bv.Boolean()
ListSharedLinksResult._cursor_validator = bv.Nullable(bv.String())
ListSharedLinksResult._all_field_names_ = set([
'links',
'has_more',
'cursor',
])
ListSharedLinksResult._all_fields_ = [
('links', ListSharedLinksResult._links_validator),
('has_more', ListSharedLinksResult._has_more_validator),
('cursor', ListSharedLinksResult._cursor_validator),
]
MemberAccessLevelResult._access_level_validator = bv.Nullable(AccessLevel_validator)
MemberAccessLevelResult._warning_validator = bv.Nullable(bv.String())
MemberAccessLevelResult._access_details_validator = bv.Nullable(bv.List(ParentFolderAccessInfo_validator))
MemberAccessLevelResult._all_field_names_ = set([
'access_level',
'warning',
'access_details',
])
MemberAccessLevelResult._all_fields_ = [
('access_level', MemberAccessLevelResult._access_level_validator),
('warning', MemberAccessLevelResult._warning_validator),
('access_details', MemberAccessLevelResult._access_details_validator),
]
MemberAction._leave_a_copy_validator = bv.Void()
MemberAction._make_editor_validator = bv.Void()
MemberAction._make_owner_validator = bv.Void()
MemberAction._make_viewer_validator = bv.Void()
MemberAction._make_viewer_no_comment_validator = bv.Void()
MemberAction._remove_validator = bv.Void()
MemberAction._other_validator = bv.Void()
MemberAction._tagmap = {
'leave_a_copy': MemberAction._leave_a_copy_validator,
'make_editor': MemberAction._make_editor_validator,
'make_owner': MemberAction._make_owner_validator,
'make_viewer': MemberAction._make_viewer_validator,
'make_viewer_no_comment': MemberAction._make_viewer_no_comment_validator,
'remove': MemberAction._remove_validator,
'other': MemberAction._other_validator,
}
MemberAction.leave_a_copy = MemberAction('leave_a_copy')
MemberAction.make_editor = MemberAction('make_editor')
MemberAction.make_owner = MemberAction('make_owner')
MemberAction.make_viewer = MemberAction('make_viewer')
MemberAction.make_viewer_no_comment = MemberAction('make_viewer_no_comment')
MemberAction.remove = MemberAction('remove')
MemberAction.other = MemberAction('other')
MemberPermission._action_validator = MemberAction_validator
MemberPermission._allow_validator = bv.Boolean()
MemberPermission._reason_validator = bv.Nullable(PermissionDeniedReason_validator)
MemberPermission._all_field_names_ = set([
'action',
'allow',
'reason',
])
MemberPermission._all_fields_ = [
('action', MemberPermission._action_validator),
('allow', MemberPermission._allow_validator),
('reason', MemberPermission._reason_validator),
]
MemberPolicy._team_validator = bv.Void()
MemberPolicy._anyone_validator = bv.Void()
MemberPolicy._other_validator = bv.Void()
MemberPolicy._tagmap = {
'team': MemberPolicy._team_validator,
'anyone': MemberPolicy._anyone_validator,
'other': MemberPolicy._other_validator,
}
MemberPolicy.team = MemberPolicy('team')
MemberPolicy.anyone = MemberPolicy('anyone')
MemberPolicy.other = MemberPolicy('other')
MemberSelector._dropbox_id_validator = DropboxId_validator
MemberSelector._email_validator = common.EmailAddress_validator
MemberSelector._other_validator = bv.Void()
MemberSelector._tagmap = {
'dropbox_id': MemberSelector._dropbox_id_validator,
'email': MemberSelector._email_validator,
'other': MemberSelector._other_validator,
}
MemberSelector.other = MemberSelector('other')
ModifySharedLinkSettingsArgs._url_validator = bv.String()
ModifySharedLinkSettingsArgs._settings_validator = SharedLinkSettings_validator
ModifySharedLinkSettingsArgs._remove_expiration_validator = bv.Boolean()
ModifySharedLinkSettingsArgs._all_field_names_ = set([
'url',
'settings',
'remove_expiration',
])
ModifySharedLinkSettingsArgs._all_fields_ = [
('url', ModifySharedLinkSettingsArgs._url_validator),
('settings', ModifySharedLinkSettingsArgs._settings_validator),
('remove_expiration', ModifySharedLinkSettingsArgs._remove_expiration_validator),
]
ModifySharedLinkSettingsError._settings_error_validator = SharedLinkSettingsError_validator
ModifySharedLinkSettingsError._email_not_verified_validator = bv.Void()
ModifySharedLinkSettingsError._tagmap = {
'settings_error': ModifySharedLinkSettingsError._settings_error_validator,
'email_not_verified': ModifySharedLinkSettingsError._email_not_verified_validator,
}
ModifySharedLinkSettingsError._tagmap.update(SharedLinkError._tagmap)
ModifySharedLinkSettingsError.email_not_verified = ModifySharedLinkSettingsError('email_not_verified')
MountFolderArg._shared_folder_id_validator = common.SharedFolderId_validator
MountFolderArg._all_field_names_ = set(['shared_folder_id'])
MountFolderArg._all_fields_ = [('shared_folder_id', MountFolderArg._shared_folder_id_validator)]
MountFolderError._access_error_validator = SharedFolderAccessError_validator
MountFolderError._inside_shared_folder_validator = bv.Void()
MountFolderError._insufficient_quota_validator = InsufficientQuotaAmounts_validator
MountFolderError._already_mounted_validator = bv.Void()
MountFolderError._no_permission_validator = bv.Void()
MountFolderError._not_mountable_validator = bv.Void()
MountFolderError._other_validator = bv.Void()
MountFolderError._tagmap = {
'access_error': MountFolderError._access_error_validator,
'inside_shared_folder': MountFolderError._inside_shared_folder_validator,
'insufficient_quota': MountFolderError._insufficient_quota_validator,
'already_mounted': MountFolderError._already_mounted_validator,
'no_permission': MountFolderError._no_permission_validator,
'not_mountable': MountFolderError._not_mountable_validator,
'other': MountFolderError._other_validator,
}
MountFolderError.inside_shared_folder = MountFolderError('inside_shared_folder')
MountFolderError.already_mounted = MountFolderError('already_mounted')
MountFolderError.no_permission = MountFolderError('no_permission')
MountFolderError.not_mountable = MountFolderError('not_mountable')
MountFolderError.other = MountFolderError('other')
ParentFolderAccessInfo._folder_name_validator = bv.String()
ParentFolderAccessInfo._shared_folder_id_validator = common.SharedFolderId_validator
ParentFolderAccessInfo._permissions_validator = bv.List(MemberPermission_validator)
ParentFolderAccessInfo._path_validator = bv.String()
ParentFolderAccessInfo._all_field_names_ = set([
'folder_name',
'shared_folder_id',
'permissions',
'path',
])
ParentFolderAccessInfo._all_fields_ = [
('folder_name', ParentFolderAccessInfo._folder_name_validator),
('shared_folder_id', ParentFolderAccessInfo._shared_folder_id_validator),
('permissions', ParentFolderAccessInfo._permissions_validator),
('path', ParentFolderAccessInfo._path_validator),
]
PathLinkMetadata._path_validator = bv.String()
PathLinkMetadata._field_names_ = set(['path'])
PathLinkMetadata._all_field_names_ = LinkMetadata._all_field_names_.union(PathLinkMetadata._field_names_)
PathLinkMetadata._fields_ = [('path', PathLinkMetadata._path_validator)]
PathLinkMetadata._all_fields_ = LinkMetadata._all_fields_ + PathLinkMetadata._fields_
PendingUploadMode._file_validator = bv.Void()
PendingUploadMode._folder_validator = bv.Void()
PendingUploadMode._tagmap = {
'file': PendingUploadMode._file_validator,
'folder': PendingUploadMode._folder_validator,
}
PendingUploadMode.file = PendingUploadMode('file')
PendingUploadMode.folder = PendingUploadMode('folder')
PermissionDeniedReason._user_not_same_team_as_owner_validator = bv.Void()
PermissionDeniedReason._user_not_allowed_by_owner_validator = bv.Void()
PermissionDeniedReason._target_is_indirect_member_validator = bv.Void()
PermissionDeniedReason._target_is_owner_validator = bv.Void()
PermissionDeniedReason._target_is_self_validator = bv.Void()
PermissionDeniedReason._target_not_active_validator = bv.Void()
PermissionDeniedReason._folder_is_limited_team_folder_validator = bv.Void()
PermissionDeniedReason._owner_not_on_team_validator = bv.Void()
PermissionDeniedReason._permission_denied_validator = bv.Void()
PermissionDeniedReason._restricted_by_team_validator = bv.Void()
PermissionDeniedReason._user_account_type_validator = bv.Void()
PermissionDeniedReason._user_not_on_team_validator = bv.Void()
PermissionDeniedReason._folder_is_inside_shared_folder_validator = bv.Void()
PermissionDeniedReason._restricted_by_parent_folder_validator = bv.Void()
PermissionDeniedReason._insufficient_plan_validator = InsufficientPlan_validator
PermissionDeniedReason._other_validator = bv.Void()
PermissionDeniedReason._tagmap = {
'user_not_same_team_as_owner': PermissionDeniedReason._user_not_same_team_as_owner_validator,
'user_not_allowed_by_owner': PermissionDeniedReason._user_not_allowed_by_owner_validator,
'target_is_indirect_member': PermissionDeniedReason._target_is_indirect_member_validator,
'target_is_owner': PermissionDeniedReason._target_is_owner_validator,
'target_is_self': PermissionDeniedReason._target_is_self_validator,
'target_not_active': PermissionDeniedReason._target_not_active_validator,
'folder_is_limited_team_folder': PermissionDeniedReason._folder_is_limited_team_folder_validator,
'owner_not_on_team': PermissionDeniedReason._owner_not_on_team_validator,
'permission_denied': PermissionDeniedReason._permission_denied_validator,
'restricted_by_team': PermissionDeniedReason._restricted_by_team_validator,
'user_account_type': PermissionDeniedReason._user_account_type_validator,
'user_not_on_team': PermissionDeniedReason._user_not_on_team_validator,
'folder_is_inside_shared_folder': PermissionDeniedReason._folder_is_inside_shared_folder_validator,
'restricted_by_parent_folder': PermissionDeniedReason._restricted_by_parent_folder_validator,
'insufficient_plan': PermissionDeniedReason._insufficient_plan_validator,
'other': PermissionDeniedReason._other_validator,
}
PermissionDeniedReason.user_not_same_team_as_owner = PermissionDeniedReason('user_not_same_team_as_owner')
PermissionDeniedReason.user_not_allowed_by_owner = PermissionDeniedReason('user_not_allowed_by_owner')
PermissionDeniedReason.target_is_indirect_member = PermissionDeniedReason('target_is_indirect_member')
PermissionDeniedReason.target_is_owner = PermissionDeniedReason('target_is_owner')
PermissionDeniedReason.target_is_self = PermissionDeniedReason('target_is_self')
PermissionDeniedReason.target_not_active = PermissionDeniedReason('target_not_active')
PermissionDeniedReason.folder_is_limited_team_folder = PermissionDeniedReason('folder_is_limited_team_folder')
PermissionDeniedReason.owner_not_on_team = PermissionDeniedReason('owner_not_on_team')
PermissionDeniedReason.permission_denied = PermissionDeniedReason('permission_denied')
PermissionDeniedReason.restricted_by_team = PermissionDeniedReason('restricted_by_team')
PermissionDeniedReason.user_account_type = PermissionDeniedReason('user_account_type')
PermissionDeniedReason.user_not_on_team = PermissionDeniedReason('user_not_on_team')
PermissionDeniedReason.folder_is_inside_shared_folder = PermissionDeniedReason('folder_is_inside_shared_folder')
PermissionDeniedReason.restricted_by_parent_folder = PermissionDeniedReason('restricted_by_parent_folder')
PermissionDeniedReason.other = PermissionDeniedReason('other')
RelinquishFileMembershipArg._file_validator = PathOrId_validator
RelinquishFileMembershipArg._all_field_names_ = set(['file'])
RelinquishFileMembershipArg._all_fields_ = [('file', RelinquishFileMembershipArg._file_validator)]
RelinquishFileMembershipError._access_error_validator = SharingFileAccessError_validator
RelinquishFileMembershipError._group_access_validator = bv.Void()
RelinquishFileMembershipError._no_permission_validator = bv.Void()
RelinquishFileMembershipError._other_validator = bv.Void()
RelinquishFileMembershipError._tagmap = {
'access_error': RelinquishFileMembershipError._access_error_validator,
'group_access': RelinquishFileMembershipError._group_access_validator,
'no_permission': RelinquishFileMembershipError._no_permission_validator,
'other': RelinquishFileMembershipError._other_validator,
}
RelinquishFileMembershipError.group_access = RelinquishFileMembershipError('group_access')
RelinquishFileMembershipError.no_permission = RelinquishFileMembershipError('no_permission')
RelinquishFileMembershipError.other = RelinquishFileMembershipError('other')
RelinquishFolderMembershipArg._shared_folder_id_validator = common.SharedFolderId_validator
RelinquishFolderMembershipArg._leave_a_copy_validator = bv.Boolean()
RelinquishFolderMembershipArg._all_field_names_ = set([
'shared_folder_id',
'leave_a_copy',
])
RelinquishFolderMembershipArg._all_fields_ = [
('shared_folder_id', RelinquishFolderMembershipArg._shared_folder_id_validator),
('leave_a_copy', RelinquishFolderMembershipArg._leave_a_copy_validator),
]
RelinquishFolderMembershipError._access_error_validator = SharedFolderAccessError_validator
RelinquishFolderMembershipError._folder_owner_validator = bv.Void()
RelinquishFolderMembershipError._mounted_validator = bv.Void()
RelinquishFolderMembershipError._group_access_validator = bv.Void()
RelinquishFolderMembershipError._team_folder_validator = bv.Void()
RelinquishFolderMembershipError._no_permission_validator = bv.Void()
RelinquishFolderMembershipError._no_explicit_access_validator = bv.Void()
RelinquishFolderMembershipError._other_validator = bv.Void()
RelinquishFolderMembershipError._tagmap = {
'access_error': RelinquishFolderMembershipError._access_error_validator,
'folder_owner': RelinquishFolderMembershipError._folder_owner_validator,
'mounted': RelinquishFolderMembershipError._mounted_validator,
'group_access': RelinquishFolderMembershipError._group_access_validator,
'team_folder': RelinquishFolderMembershipError._team_folder_validator,
'no_permission': RelinquishFolderMembershipError._no_permission_validator,
'no_explicit_access': RelinquishFolderMembershipError._no_explicit_access_validator,
'other': RelinquishFolderMembershipError._other_validator,
}
RelinquishFolderMembershipError.folder_owner = RelinquishFolderMembershipError('folder_owner')
RelinquishFolderMembershipError.mounted = RelinquishFolderMembershipError('mounted')
RelinquishFolderMembershipError.group_access = RelinquishFolderMembershipError('group_access')
RelinquishFolderMembershipError.team_folder = RelinquishFolderMembershipError('team_folder')
RelinquishFolderMembershipError.no_permission = RelinquishFolderMembershipError('no_permission')
RelinquishFolderMembershipError.no_explicit_access = RelinquishFolderMembershipError('no_explicit_access')
RelinquishFolderMembershipError.other = RelinquishFolderMembershipError('other')
RemoveFileMemberArg._file_validator = PathOrId_validator
RemoveFileMemberArg._member_validator = MemberSelector_validator
RemoveFileMemberArg._all_field_names_ = set([
'file',
'member',
])
RemoveFileMemberArg._all_fields_ = [
('file', RemoveFileMemberArg._file_validator),
('member', RemoveFileMemberArg._member_validator),
]
RemoveFileMemberError._user_error_validator = SharingUserError_validator
RemoveFileMemberError._access_error_validator = SharingFileAccessError_validator
RemoveFileMemberError._no_explicit_access_validator = MemberAccessLevelResult_validator
RemoveFileMemberError._other_validator = bv.Void()
RemoveFileMemberError._tagmap = {
'user_error': RemoveFileMemberError._user_error_validator,
'access_error': RemoveFileMemberError._access_error_validator,
'no_explicit_access': RemoveFileMemberError._no_explicit_access_validator,
'other': RemoveFileMemberError._other_validator,
}
RemoveFileMemberError.other = RemoveFileMemberError('other')
RemoveFolderMemberArg._shared_folder_id_validator = common.SharedFolderId_validator
RemoveFolderMemberArg._member_validator = MemberSelector_validator
RemoveFolderMemberArg._leave_a_copy_validator = bv.Boolean()
RemoveFolderMemberArg._all_field_names_ = set([
'shared_folder_id',
'member',
'leave_a_copy',
])
RemoveFolderMemberArg._all_fields_ = [
('shared_folder_id', RemoveFolderMemberArg._shared_folder_id_validator),
('member', RemoveFolderMemberArg._member_validator),
('leave_a_copy', RemoveFolderMemberArg._leave_a_copy_validator),
]
RemoveFolderMemberError._access_error_validator = SharedFolderAccessError_validator
RemoveFolderMemberError._member_error_validator = SharedFolderMemberError_validator
RemoveFolderMemberError._folder_owner_validator = bv.Void()
RemoveFolderMemberError._group_access_validator = bv.Void()
RemoveFolderMemberError._team_folder_validator = bv.Void()
RemoveFolderMemberError._no_permission_validator = bv.Void()
2019-08-28 21:48:24 +02:00
RemoveFolderMemberError._too_many_files_validator = bv.Void()
RemoveFolderMemberError._other_validator = bv.Void()
RemoveFolderMemberError._tagmap = {
'access_error': RemoveFolderMemberError._access_error_validator,
'member_error': RemoveFolderMemberError._member_error_validator,
'folder_owner': RemoveFolderMemberError._folder_owner_validator,
'group_access': RemoveFolderMemberError._group_access_validator,
'team_folder': RemoveFolderMemberError._team_folder_validator,
'no_permission': RemoveFolderMemberError._no_permission_validator,
2019-08-28 21:48:24 +02:00
'too_many_files': RemoveFolderMemberError._too_many_files_validator,
'other': RemoveFolderMemberError._other_validator,
}
RemoveFolderMemberError.folder_owner = RemoveFolderMemberError('folder_owner')
RemoveFolderMemberError.group_access = RemoveFolderMemberError('group_access')
RemoveFolderMemberError.team_folder = RemoveFolderMemberError('team_folder')
RemoveFolderMemberError.no_permission = RemoveFolderMemberError('no_permission')
2019-08-28 21:48:24 +02:00
RemoveFolderMemberError.too_many_files = RemoveFolderMemberError('too_many_files')
RemoveFolderMemberError.other = RemoveFolderMemberError('other')
RemoveMemberJobStatus._complete_validator = MemberAccessLevelResult_validator
RemoveMemberJobStatus._failed_validator = RemoveFolderMemberError_validator
RemoveMemberJobStatus._tagmap = {
'complete': RemoveMemberJobStatus._complete_validator,
'failed': RemoveMemberJobStatus._failed_validator,
}
2019-08-28 21:48:24 +02:00
RemoveMemberJobStatus._tagmap.update(async_.PollResultBase._tagmap)
RequestedLinkAccessLevel._viewer_validator = bv.Void()
RequestedLinkAccessLevel._editor_validator = bv.Void()
RequestedLinkAccessLevel._max_validator = bv.Void()
RequestedLinkAccessLevel._other_validator = bv.Void()
RequestedLinkAccessLevel._tagmap = {
'viewer': RequestedLinkAccessLevel._viewer_validator,
'editor': RequestedLinkAccessLevel._editor_validator,
'max': RequestedLinkAccessLevel._max_validator,
'other': RequestedLinkAccessLevel._other_validator,
}
RequestedLinkAccessLevel.viewer = RequestedLinkAccessLevel('viewer')
RequestedLinkAccessLevel.editor = RequestedLinkAccessLevel('editor')
RequestedLinkAccessLevel.max = RequestedLinkAccessLevel('max')
RequestedLinkAccessLevel.other = RequestedLinkAccessLevel('other')
RequestedVisibility._public_validator = bv.Void()
RequestedVisibility._team_only_validator = bv.Void()
RequestedVisibility._password_validator = bv.Void()
RequestedVisibility._tagmap = {
'public': RequestedVisibility._public_validator,
'team_only': RequestedVisibility._team_only_validator,
'password': RequestedVisibility._password_validator,
}
RequestedVisibility.public = RequestedVisibility('public')
RequestedVisibility.team_only = RequestedVisibility('team_only')
RequestedVisibility.password = RequestedVisibility('password')
ResolvedVisibility._team_and_password_validator = bv.Void()
ResolvedVisibility._shared_folder_only_validator = bv.Void()
ResolvedVisibility._other_validator = bv.Void()
ResolvedVisibility._tagmap = {
'team_and_password': ResolvedVisibility._team_and_password_validator,
'shared_folder_only': ResolvedVisibility._shared_folder_only_validator,
'other': ResolvedVisibility._other_validator,
}
ResolvedVisibility._tagmap.update(RequestedVisibility._tagmap)
ResolvedVisibility.team_and_password = ResolvedVisibility('team_and_password')
ResolvedVisibility.shared_folder_only = ResolvedVisibility('shared_folder_only')
ResolvedVisibility.other = ResolvedVisibility('other')
RevokeSharedLinkArg._url_validator = bv.String()
RevokeSharedLinkArg._all_field_names_ = set(['url'])
RevokeSharedLinkArg._all_fields_ = [('url', RevokeSharedLinkArg._url_validator)]
RevokeSharedLinkError._shared_link_malformed_validator = bv.Void()
RevokeSharedLinkError._tagmap = {
'shared_link_malformed': RevokeSharedLinkError._shared_link_malformed_validator,
}
RevokeSharedLinkError._tagmap.update(SharedLinkError._tagmap)
RevokeSharedLinkError.shared_link_malformed = RevokeSharedLinkError('shared_link_malformed')
2019-08-28 21:48:24 +02:00
SetAccessInheritanceArg._access_inheritance_validator = AccessInheritance_validator
SetAccessInheritanceArg._shared_folder_id_validator = common.SharedFolderId_validator
SetAccessInheritanceArg._all_field_names_ = set([
'access_inheritance',
'shared_folder_id',
])
SetAccessInheritanceArg._all_fields_ = [
('access_inheritance', SetAccessInheritanceArg._access_inheritance_validator),
('shared_folder_id', SetAccessInheritanceArg._shared_folder_id_validator),
]
SetAccessInheritanceError._access_error_validator = SharedFolderAccessError_validator
SetAccessInheritanceError._no_permission_validator = bv.Void()
SetAccessInheritanceError._other_validator = bv.Void()
SetAccessInheritanceError._tagmap = {
'access_error': SetAccessInheritanceError._access_error_validator,
'no_permission': SetAccessInheritanceError._no_permission_validator,
'other': SetAccessInheritanceError._other_validator,
}
SetAccessInheritanceError.no_permission = SetAccessInheritanceError('no_permission')
SetAccessInheritanceError.other = SetAccessInheritanceError('other')
ShareFolderArgBase._acl_update_policy_validator = bv.Nullable(AclUpdatePolicy_validator)
ShareFolderArgBase._force_async_validator = bv.Boolean()
ShareFolderArgBase._member_policy_validator = bv.Nullable(MemberPolicy_validator)
ShareFolderArgBase._path_validator = files.WritePath_validator
ShareFolderArgBase._shared_link_policy_validator = bv.Nullable(SharedLinkPolicy_validator)
ShareFolderArgBase._viewer_info_policy_validator = bv.Nullable(ViewerInfoPolicy_validator)
2019-08-28 21:48:24 +02:00
ShareFolderArgBase._access_inheritance_validator = AccessInheritance_validator
ShareFolderArgBase._all_field_names_ = set([
'acl_update_policy',
'force_async',
'member_policy',
'path',
'shared_link_policy',
'viewer_info_policy',
2019-08-28 21:48:24 +02:00
'access_inheritance',
])
ShareFolderArgBase._all_fields_ = [
('acl_update_policy', ShareFolderArgBase._acl_update_policy_validator),
('force_async', ShareFolderArgBase._force_async_validator),
('member_policy', ShareFolderArgBase._member_policy_validator),
('path', ShareFolderArgBase._path_validator),
('shared_link_policy', ShareFolderArgBase._shared_link_policy_validator),
('viewer_info_policy', ShareFolderArgBase._viewer_info_policy_validator),
2019-08-28 21:48:24 +02:00
('access_inheritance', ShareFolderArgBase._access_inheritance_validator),
]
ShareFolderArg._actions_validator = bv.Nullable(bv.List(FolderAction_validator))
ShareFolderArg._link_settings_validator = bv.Nullable(LinkSettings_validator)
ShareFolderArg._all_field_names_ = ShareFolderArgBase._all_field_names_.union(set([
'actions',
'link_settings',
]))
ShareFolderArg._all_fields_ = ShareFolderArgBase._all_fields_ + [
('actions', ShareFolderArg._actions_validator),
('link_settings', ShareFolderArg._link_settings_validator),
]
ShareFolderErrorBase._email_unverified_validator = bv.Void()
ShareFolderErrorBase._bad_path_validator = SharePathError_validator
ShareFolderErrorBase._team_policy_disallows_member_policy_validator = bv.Void()
ShareFolderErrorBase._disallowed_shared_link_policy_validator = bv.Void()
ShareFolderErrorBase._other_validator = bv.Void()
ShareFolderErrorBase._tagmap = {
'email_unverified': ShareFolderErrorBase._email_unverified_validator,
'bad_path': ShareFolderErrorBase._bad_path_validator,
'team_policy_disallows_member_policy': ShareFolderErrorBase._team_policy_disallows_member_policy_validator,
'disallowed_shared_link_policy': ShareFolderErrorBase._disallowed_shared_link_policy_validator,
'other': ShareFolderErrorBase._other_validator,
}
ShareFolderErrorBase.email_unverified = ShareFolderErrorBase('email_unverified')
ShareFolderErrorBase.team_policy_disallows_member_policy = ShareFolderErrorBase('team_policy_disallows_member_policy')
ShareFolderErrorBase.disallowed_shared_link_policy = ShareFolderErrorBase('disallowed_shared_link_policy')
ShareFolderErrorBase.other = ShareFolderErrorBase('other')
ShareFolderError._no_permission_validator = bv.Void()
ShareFolderError._tagmap = {
'no_permission': ShareFolderError._no_permission_validator,
}
ShareFolderError._tagmap.update(ShareFolderErrorBase._tagmap)
ShareFolderError.no_permission = ShareFolderError('no_permission')
ShareFolderJobStatus._complete_validator = SharedFolderMetadata_validator
ShareFolderJobStatus._failed_validator = ShareFolderError_validator
ShareFolderJobStatus._tagmap = {
'complete': ShareFolderJobStatus._complete_validator,
'failed': ShareFolderJobStatus._failed_validator,
}
2019-08-28 21:48:24 +02:00
ShareFolderJobStatus._tagmap.update(async_.PollResultBase._tagmap)
ShareFolderLaunch._complete_validator = SharedFolderMetadata_validator
ShareFolderLaunch._tagmap = {
'complete': ShareFolderLaunch._complete_validator,
}
2019-08-28 21:48:24 +02:00
ShareFolderLaunch._tagmap.update(async_.LaunchResultBase._tagmap)
SharePathError._is_file_validator = bv.Void()
SharePathError._inside_shared_folder_validator = bv.Void()
SharePathError._contains_shared_folder_validator = bv.Void()
SharePathError._contains_app_folder_validator = bv.Void()
SharePathError._contains_team_folder_validator = bv.Void()
SharePathError._is_app_folder_validator = bv.Void()
SharePathError._inside_app_folder_validator = bv.Void()
SharePathError._is_public_folder_validator = bv.Void()
SharePathError._inside_public_folder_validator = bv.Void()
SharePathError._already_shared_validator = SharedFolderMetadata_validator
SharePathError._invalid_path_validator = bv.Void()
SharePathError._is_osx_package_validator = bv.Void()
SharePathError._inside_osx_package_validator = bv.Void()
SharePathError._other_validator = bv.Void()
SharePathError._tagmap = {
'is_file': SharePathError._is_file_validator,
'inside_shared_folder': SharePathError._inside_shared_folder_validator,
'contains_shared_folder': SharePathError._contains_shared_folder_validator,
'contains_app_folder': SharePathError._contains_app_folder_validator,
'contains_team_folder': SharePathError._contains_team_folder_validator,
'is_app_folder': SharePathError._is_app_folder_validator,
'inside_app_folder': SharePathError._inside_app_folder_validator,
'is_public_folder': SharePathError._is_public_folder_validator,
'inside_public_folder': SharePathError._inside_public_folder_validator,
'already_shared': SharePathError._already_shared_validator,
'invalid_path': SharePathError._invalid_path_validator,
'is_osx_package': SharePathError._is_osx_package_validator,
'inside_osx_package': SharePathError._inside_osx_package_validator,
'other': SharePathError._other_validator,
}
SharePathError.is_file = SharePathError('is_file')
SharePathError.inside_shared_folder = SharePathError('inside_shared_folder')
SharePathError.contains_shared_folder = SharePathError('contains_shared_folder')
SharePathError.contains_app_folder = SharePathError('contains_app_folder')
SharePathError.contains_team_folder = SharePathError('contains_team_folder')
SharePathError.is_app_folder = SharePathError('is_app_folder')
SharePathError.inside_app_folder = SharePathError('inside_app_folder')
SharePathError.is_public_folder = SharePathError('is_public_folder')
SharePathError.inside_public_folder = SharePathError('inside_public_folder')
SharePathError.invalid_path = SharePathError('invalid_path')
SharePathError.is_osx_package = SharePathError('is_osx_package')
SharePathError.inside_osx_package = SharePathError('inside_osx_package')
SharePathError.other = SharePathError('other')
SharedContentLinkMetadata._audience_exceptions_validator = bv.Nullable(AudienceExceptions_validator)
SharedContentLinkMetadata._url_validator = bv.String()
SharedContentLinkMetadata._all_field_names_ = SharedContentLinkMetadataBase._all_field_names_.union(set([
'audience_exceptions',
'url',
]))
SharedContentLinkMetadata._all_fields_ = SharedContentLinkMetadataBase._all_fields_ + [
('audience_exceptions', SharedContentLinkMetadata._audience_exceptions_validator),
('url', SharedContentLinkMetadata._url_validator),
]
SharedFileMembers._users_validator = bv.List(UserFileMembershipInfo_validator)
SharedFileMembers._groups_validator = bv.List(GroupMembershipInfo_validator)
SharedFileMembers._invitees_validator = bv.List(InviteeMembershipInfo_validator)
SharedFileMembers._cursor_validator = bv.Nullable(bv.String())
SharedFileMembers._all_field_names_ = set([
'users',
'groups',
'invitees',
'cursor',
])
SharedFileMembers._all_fields_ = [
('users', SharedFileMembers._users_validator),
('groups', SharedFileMembers._groups_validator),
('invitees', SharedFileMembers._invitees_validator),
('cursor', SharedFileMembers._cursor_validator),
]
SharedFileMetadata._access_type_validator = bv.Nullable(AccessLevel_validator)
2019-08-28 21:48:24 +02:00
SharedFileMetadata._id_validator = files.FileId_validator
SharedFileMetadata._expected_link_metadata_validator = bv.Nullable(ExpectedSharedContentLinkMetadata_validator)
SharedFileMetadata._link_metadata_validator = bv.Nullable(SharedContentLinkMetadata_validator)
SharedFileMetadata._name_validator = bv.String()
SharedFileMetadata._owner_display_names_validator = bv.Nullable(bv.List(bv.String()))
SharedFileMetadata._owner_team_validator = bv.Nullable(users.Team_validator)
SharedFileMetadata._parent_shared_folder_id_validator = bv.Nullable(common.SharedFolderId_validator)
SharedFileMetadata._path_display_validator = bv.Nullable(bv.String())
SharedFileMetadata._path_lower_validator = bv.Nullable(bv.String())
SharedFileMetadata._permissions_validator = bv.Nullable(bv.List(FilePermission_validator))
SharedFileMetadata._policy_validator = FolderPolicy_validator
SharedFileMetadata._preview_url_validator = bv.String()
SharedFileMetadata._time_invited_validator = bv.Nullable(common.DropboxTimestamp_validator)
SharedFileMetadata._all_field_names_ = set([
'access_type',
'id',
'expected_link_metadata',
'link_metadata',
'name',
'owner_display_names',
'owner_team',
'parent_shared_folder_id',
'path_display',
'path_lower',
'permissions',
'policy',
'preview_url',
'time_invited',
])
SharedFileMetadata._all_fields_ = [
('access_type', SharedFileMetadata._access_type_validator),
('id', SharedFileMetadata._id_validator),
('expected_link_metadata', SharedFileMetadata._expected_link_metadata_validator),
('link_metadata', SharedFileMetadata._link_metadata_validator),
('name', SharedFileMetadata._name_validator),
('owner_display_names', SharedFileMetadata._owner_display_names_validator),
('owner_team', SharedFileMetadata._owner_team_validator),
('parent_shared_folder_id', SharedFileMetadata._parent_shared_folder_id_validator),
('path_display', SharedFileMetadata._path_display_validator),
('path_lower', SharedFileMetadata._path_lower_validator),
('permissions', SharedFileMetadata._permissions_validator),
('policy', SharedFileMetadata._policy_validator),
('preview_url', SharedFileMetadata._preview_url_validator),
('time_invited', SharedFileMetadata._time_invited_validator),
]
SharedFolderAccessError._invalid_id_validator = bv.Void()
SharedFolderAccessError._not_a_member_validator = bv.Void()
SharedFolderAccessError._email_unverified_validator = bv.Void()
SharedFolderAccessError._unmounted_validator = bv.Void()
SharedFolderAccessError._other_validator = bv.Void()
SharedFolderAccessError._tagmap = {
'invalid_id': SharedFolderAccessError._invalid_id_validator,
'not_a_member': SharedFolderAccessError._not_a_member_validator,
'email_unverified': SharedFolderAccessError._email_unverified_validator,
'unmounted': SharedFolderAccessError._unmounted_validator,
'other': SharedFolderAccessError._other_validator,
}
SharedFolderAccessError.invalid_id = SharedFolderAccessError('invalid_id')
SharedFolderAccessError.not_a_member = SharedFolderAccessError('not_a_member')
SharedFolderAccessError.email_unverified = SharedFolderAccessError('email_unverified')
SharedFolderAccessError.unmounted = SharedFolderAccessError('unmounted')
SharedFolderAccessError.other = SharedFolderAccessError('other')
SharedFolderMemberError._invalid_dropbox_id_validator = bv.Void()
SharedFolderMemberError._not_a_member_validator = bv.Void()
SharedFolderMemberError._no_explicit_access_validator = MemberAccessLevelResult_validator
SharedFolderMemberError._other_validator = bv.Void()
SharedFolderMemberError._tagmap = {
'invalid_dropbox_id': SharedFolderMemberError._invalid_dropbox_id_validator,
'not_a_member': SharedFolderMemberError._not_a_member_validator,
'no_explicit_access': SharedFolderMemberError._no_explicit_access_validator,
'other': SharedFolderMemberError._other_validator,
}
SharedFolderMemberError.invalid_dropbox_id = SharedFolderMemberError('invalid_dropbox_id')
SharedFolderMemberError.not_a_member = SharedFolderMemberError('not_a_member')
SharedFolderMemberError.other = SharedFolderMemberError('other')
SharedFolderMembers._users_validator = bv.List(UserMembershipInfo_validator)
SharedFolderMembers._groups_validator = bv.List(GroupMembershipInfo_validator)
SharedFolderMembers._invitees_validator = bv.List(InviteeMembershipInfo_validator)
SharedFolderMembers._cursor_validator = bv.Nullable(bv.String())
SharedFolderMembers._all_field_names_ = set([
'users',
'groups',
'invitees',
'cursor',
])
SharedFolderMembers._all_fields_ = [
('users', SharedFolderMembers._users_validator),
('groups', SharedFolderMembers._groups_validator),
('invitees', SharedFolderMembers._invitees_validator),
('cursor', SharedFolderMembers._cursor_validator),
]
SharedFolderMetadataBase._access_type_validator = AccessLevel_validator
SharedFolderMetadataBase._is_inside_team_folder_validator = bv.Boolean()
SharedFolderMetadataBase._is_team_folder_validator = bv.Boolean()
SharedFolderMetadataBase._owner_display_names_validator = bv.Nullable(bv.List(bv.String()))
SharedFolderMetadataBase._owner_team_validator = bv.Nullable(users.Team_validator)
SharedFolderMetadataBase._parent_shared_folder_id_validator = bv.Nullable(common.SharedFolderId_validator)
SharedFolderMetadataBase._path_lower_validator = bv.Nullable(bv.String())
SharedFolderMetadataBase._all_field_names_ = set([
'access_type',
'is_inside_team_folder',
'is_team_folder',
'owner_display_names',
'owner_team',
'parent_shared_folder_id',
'path_lower',
])
SharedFolderMetadataBase._all_fields_ = [
('access_type', SharedFolderMetadataBase._access_type_validator),
('is_inside_team_folder', SharedFolderMetadataBase._is_inside_team_folder_validator),
('is_team_folder', SharedFolderMetadataBase._is_team_folder_validator),
('owner_display_names', SharedFolderMetadataBase._owner_display_names_validator),
('owner_team', SharedFolderMetadataBase._owner_team_validator),
('parent_shared_folder_id', SharedFolderMetadataBase._parent_shared_folder_id_validator),
('path_lower', SharedFolderMetadataBase._path_lower_validator),
]
SharedFolderMetadata._link_metadata_validator = bv.Nullable(SharedContentLinkMetadata_validator)
SharedFolderMetadata._name_validator = bv.String()
SharedFolderMetadata._permissions_validator = bv.Nullable(bv.List(FolderPermission_validator))
SharedFolderMetadata._policy_validator = FolderPolicy_validator
SharedFolderMetadata._preview_url_validator = bv.String()
SharedFolderMetadata._shared_folder_id_validator = common.SharedFolderId_validator
SharedFolderMetadata._time_invited_validator = common.DropboxTimestamp_validator
2019-08-28 21:48:24 +02:00
SharedFolderMetadata._access_inheritance_validator = AccessInheritance_validator
SharedFolderMetadata._all_field_names_ = SharedFolderMetadataBase._all_field_names_.union(set([
'link_metadata',
'name',
'permissions',
'policy',
'preview_url',
'shared_folder_id',
'time_invited',
2019-08-28 21:48:24 +02:00
'access_inheritance',
]))
SharedFolderMetadata._all_fields_ = SharedFolderMetadataBase._all_fields_ + [
('link_metadata', SharedFolderMetadata._link_metadata_validator),
('name', SharedFolderMetadata._name_validator),
('permissions', SharedFolderMetadata._permissions_validator),
('policy', SharedFolderMetadata._policy_validator),
('preview_url', SharedFolderMetadata._preview_url_validator),
('shared_folder_id', SharedFolderMetadata._shared_folder_id_validator),
('time_invited', SharedFolderMetadata._time_invited_validator),
2019-08-28 21:48:24 +02:00
('access_inheritance', SharedFolderMetadata._access_inheritance_validator),
]
SharedLinkAccessFailureReason._login_required_validator = bv.Void()
SharedLinkAccessFailureReason._email_verify_required_validator = bv.Void()
SharedLinkAccessFailureReason._password_required_validator = bv.Void()
SharedLinkAccessFailureReason._team_only_validator = bv.Void()
SharedLinkAccessFailureReason._owner_only_validator = bv.Void()
SharedLinkAccessFailureReason._other_validator = bv.Void()
SharedLinkAccessFailureReason._tagmap = {
'login_required': SharedLinkAccessFailureReason._login_required_validator,
'email_verify_required': SharedLinkAccessFailureReason._email_verify_required_validator,
'password_required': SharedLinkAccessFailureReason._password_required_validator,
'team_only': SharedLinkAccessFailureReason._team_only_validator,
'owner_only': SharedLinkAccessFailureReason._owner_only_validator,
'other': SharedLinkAccessFailureReason._other_validator,
}
SharedLinkAccessFailureReason.login_required = SharedLinkAccessFailureReason('login_required')
SharedLinkAccessFailureReason.email_verify_required = SharedLinkAccessFailureReason('email_verify_required')
SharedLinkAccessFailureReason.password_required = SharedLinkAccessFailureReason('password_required')
SharedLinkAccessFailureReason.team_only = SharedLinkAccessFailureReason('team_only')
SharedLinkAccessFailureReason.owner_only = SharedLinkAccessFailureReason('owner_only')
SharedLinkAccessFailureReason.other = SharedLinkAccessFailureReason('other')
2019-08-28 21:48:24 +02:00
SharedLinkAlreadyExistsMetadata._metadata_validator = SharedLinkMetadata_validator
SharedLinkAlreadyExistsMetadata._other_validator = bv.Void()
SharedLinkAlreadyExistsMetadata._tagmap = {
'metadata': SharedLinkAlreadyExistsMetadata._metadata_validator,
'other': SharedLinkAlreadyExistsMetadata._other_validator,
}
SharedLinkAlreadyExistsMetadata.other = SharedLinkAlreadyExistsMetadata('other')
SharedLinkPolicy._anyone_validator = bv.Void()
SharedLinkPolicy._team_validator = bv.Void()
SharedLinkPolicy._members_validator = bv.Void()
SharedLinkPolicy._other_validator = bv.Void()
SharedLinkPolicy._tagmap = {
'anyone': SharedLinkPolicy._anyone_validator,
'team': SharedLinkPolicy._team_validator,
'members': SharedLinkPolicy._members_validator,
'other': SharedLinkPolicy._other_validator,
}
SharedLinkPolicy.anyone = SharedLinkPolicy('anyone')
SharedLinkPolicy.team = SharedLinkPolicy('team')
SharedLinkPolicy.members = SharedLinkPolicy('members')
SharedLinkPolicy.other = SharedLinkPolicy('other')
SharedLinkSettings._requested_visibility_validator = bv.Nullable(RequestedVisibility_validator)
SharedLinkSettings._link_password_validator = bv.Nullable(bv.String())
SharedLinkSettings._expires_validator = bv.Nullable(common.DropboxTimestamp_validator)
2019-08-28 21:48:24 +02:00
SharedLinkSettings._audience_validator = bv.Nullable(LinkAudience_validator)
SharedLinkSettings._access_validator = bv.Nullable(RequestedLinkAccessLevel_validator)
SharedLinkSettings._all_field_names_ = set([
'requested_visibility',
'link_password',
'expires',
2019-08-28 21:48:24 +02:00
'audience',
'access',
])
SharedLinkSettings._all_fields_ = [
('requested_visibility', SharedLinkSettings._requested_visibility_validator),
('link_password', SharedLinkSettings._link_password_validator),
('expires', SharedLinkSettings._expires_validator),
2019-08-28 21:48:24 +02:00
('audience', SharedLinkSettings._audience_validator),
('access', SharedLinkSettings._access_validator),
]
SharedLinkSettingsError._invalid_settings_validator = bv.Void()
SharedLinkSettingsError._not_authorized_validator = bv.Void()
SharedLinkSettingsError._tagmap = {
'invalid_settings': SharedLinkSettingsError._invalid_settings_validator,
'not_authorized': SharedLinkSettingsError._not_authorized_validator,
}
SharedLinkSettingsError.invalid_settings = SharedLinkSettingsError('invalid_settings')
SharedLinkSettingsError.not_authorized = SharedLinkSettingsError('not_authorized')
SharingFileAccessError._no_permission_validator = bv.Void()
SharingFileAccessError._invalid_file_validator = bv.Void()
SharingFileAccessError._is_folder_validator = bv.Void()
SharingFileAccessError._inside_public_folder_validator = bv.Void()
SharingFileAccessError._inside_osx_package_validator = bv.Void()
SharingFileAccessError._other_validator = bv.Void()
SharingFileAccessError._tagmap = {
'no_permission': SharingFileAccessError._no_permission_validator,
'invalid_file': SharingFileAccessError._invalid_file_validator,
'is_folder': SharingFileAccessError._is_folder_validator,
'inside_public_folder': SharingFileAccessError._inside_public_folder_validator,
'inside_osx_package': SharingFileAccessError._inside_osx_package_validator,
'other': SharingFileAccessError._other_validator,
}
SharingFileAccessError.no_permission = SharingFileAccessError('no_permission')
SharingFileAccessError.invalid_file = SharingFileAccessError('invalid_file')
SharingFileAccessError.is_folder = SharingFileAccessError('is_folder')
SharingFileAccessError.inside_public_folder = SharingFileAccessError('inside_public_folder')
SharingFileAccessError.inside_osx_package = SharingFileAccessError('inside_osx_package')
SharingFileAccessError.other = SharingFileAccessError('other')
SharingUserError._email_unverified_validator = bv.Void()
SharingUserError._other_validator = bv.Void()
SharingUserError._tagmap = {
'email_unverified': SharingUserError._email_unverified_validator,
'other': SharingUserError._other_validator,
}
SharingUserError.email_unverified = SharingUserError('email_unverified')
SharingUserError.other = SharingUserError('other')
TeamMemberInfo._team_info_validator = TeamInfo_validator
TeamMemberInfo._display_name_validator = bv.String()
TeamMemberInfo._member_id_validator = bv.Nullable(bv.String())
TeamMemberInfo._all_field_names_ = set([
'team_info',
'display_name',
'member_id',
])
TeamMemberInfo._all_fields_ = [
('team_info', TeamMemberInfo._team_info_validator),
('display_name', TeamMemberInfo._display_name_validator),
('member_id', TeamMemberInfo._member_id_validator),
]
TransferFolderArg._shared_folder_id_validator = common.SharedFolderId_validator
TransferFolderArg._to_dropbox_id_validator = DropboxId_validator
TransferFolderArg._all_field_names_ = set([
'shared_folder_id',
'to_dropbox_id',
])
TransferFolderArg._all_fields_ = [
('shared_folder_id', TransferFolderArg._shared_folder_id_validator),
('to_dropbox_id', TransferFolderArg._to_dropbox_id_validator),
]
TransferFolderError._access_error_validator = SharedFolderAccessError_validator
TransferFolderError._invalid_dropbox_id_validator = bv.Void()
TransferFolderError._new_owner_not_a_member_validator = bv.Void()
TransferFolderError._new_owner_unmounted_validator = bv.Void()
TransferFolderError._new_owner_email_unverified_validator = bv.Void()
TransferFolderError._team_folder_validator = bv.Void()
TransferFolderError._no_permission_validator = bv.Void()
TransferFolderError._other_validator = bv.Void()
TransferFolderError._tagmap = {
'access_error': TransferFolderError._access_error_validator,
'invalid_dropbox_id': TransferFolderError._invalid_dropbox_id_validator,
'new_owner_not_a_member': TransferFolderError._new_owner_not_a_member_validator,
'new_owner_unmounted': TransferFolderError._new_owner_unmounted_validator,
'new_owner_email_unverified': TransferFolderError._new_owner_email_unverified_validator,
'team_folder': TransferFolderError._team_folder_validator,
'no_permission': TransferFolderError._no_permission_validator,
'other': TransferFolderError._other_validator,
}
TransferFolderError.invalid_dropbox_id = TransferFolderError('invalid_dropbox_id')
TransferFolderError.new_owner_not_a_member = TransferFolderError('new_owner_not_a_member')
TransferFolderError.new_owner_unmounted = TransferFolderError('new_owner_unmounted')
TransferFolderError.new_owner_email_unverified = TransferFolderError('new_owner_email_unverified')
TransferFolderError.team_folder = TransferFolderError('team_folder')
TransferFolderError.no_permission = TransferFolderError('no_permission')
TransferFolderError.other = TransferFolderError('other')
UnmountFolderArg._shared_folder_id_validator = common.SharedFolderId_validator
UnmountFolderArg._all_field_names_ = set(['shared_folder_id'])
UnmountFolderArg._all_fields_ = [('shared_folder_id', UnmountFolderArg._shared_folder_id_validator)]
UnmountFolderError._access_error_validator = SharedFolderAccessError_validator
UnmountFolderError._no_permission_validator = bv.Void()
UnmountFolderError._not_unmountable_validator = bv.Void()
UnmountFolderError._other_validator = bv.Void()
UnmountFolderError._tagmap = {
'access_error': UnmountFolderError._access_error_validator,
'no_permission': UnmountFolderError._no_permission_validator,
'not_unmountable': UnmountFolderError._not_unmountable_validator,
'other': UnmountFolderError._other_validator,
}
UnmountFolderError.no_permission = UnmountFolderError('no_permission')
UnmountFolderError.not_unmountable = UnmountFolderError('not_unmountable')
UnmountFolderError.other = UnmountFolderError('other')
UnshareFileArg._file_validator = PathOrId_validator
UnshareFileArg._all_field_names_ = set(['file'])
UnshareFileArg._all_fields_ = [('file', UnshareFileArg._file_validator)]
UnshareFileError._user_error_validator = SharingUserError_validator
UnshareFileError._access_error_validator = SharingFileAccessError_validator
UnshareFileError._other_validator = bv.Void()
UnshareFileError._tagmap = {
'user_error': UnshareFileError._user_error_validator,
'access_error': UnshareFileError._access_error_validator,
'other': UnshareFileError._other_validator,
}
UnshareFileError.other = UnshareFileError('other')
UnshareFolderArg._shared_folder_id_validator = common.SharedFolderId_validator
UnshareFolderArg._leave_a_copy_validator = bv.Boolean()
UnshareFolderArg._all_field_names_ = set([
'shared_folder_id',
'leave_a_copy',
])
UnshareFolderArg._all_fields_ = [
('shared_folder_id', UnshareFolderArg._shared_folder_id_validator),
('leave_a_copy', UnshareFolderArg._leave_a_copy_validator),
]
UnshareFolderError._access_error_validator = SharedFolderAccessError_validator
UnshareFolderError._team_folder_validator = bv.Void()
UnshareFolderError._no_permission_validator = bv.Void()
UnshareFolderError._too_many_files_validator = bv.Void()
UnshareFolderError._other_validator = bv.Void()
UnshareFolderError._tagmap = {
'access_error': UnshareFolderError._access_error_validator,
'team_folder': UnshareFolderError._team_folder_validator,
'no_permission': UnshareFolderError._no_permission_validator,
'too_many_files': UnshareFolderError._too_many_files_validator,
'other': UnshareFolderError._other_validator,
}
UnshareFolderError.team_folder = UnshareFolderError('team_folder')
UnshareFolderError.no_permission = UnshareFolderError('no_permission')
UnshareFolderError.too_many_files = UnshareFolderError('too_many_files')
UnshareFolderError.other = UnshareFolderError('other')
UpdateFileMemberArgs._all_field_names_ = ChangeFileMemberAccessArgs._all_field_names_.union(set([]))
UpdateFileMemberArgs._all_fields_ = ChangeFileMemberAccessArgs._all_fields_ + []
UpdateFolderMemberArg._shared_folder_id_validator = common.SharedFolderId_validator
UpdateFolderMemberArg._member_validator = MemberSelector_validator
UpdateFolderMemberArg._access_level_validator = AccessLevel_validator
UpdateFolderMemberArg._all_field_names_ = set([
'shared_folder_id',
'member',
'access_level',
])
UpdateFolderMemberArg._all_fields_ = [
('shared_folder_id', UpdateFolderMemberArg._shared_folder_id_validator),
('member', UpdateFolderMemberArg._member_validator),
('access_level', UpdateFolderMemberArg._access_level_validator),
]
UpdateFolderMemberError._access_error_validator = SharedFolderAccessError_validator
UpdateFolderMemberError._member_error_validator = SharedFolderMemberError_validator
UpdateFolderMemberError._no_explicit_access_validator = AddFolderMemberError_validator
UpdateFolderMemberError._insufficient_plan_validator = bv.Void()
UpdateFolderMemberError._no_permission_validator = bv.Void()
UpdateFolderMemberError._other_validator = bv.Void()
UpdateFolderMemberError._tagmap = {
'access_error': UpdateFolderMemberError._access_error_validator,
'member_error': UpdateFolderMemberError._member_error_validator,
'no_explicit_access': UpdateFolderMemberError._no_explicit_access_validator,
'insufficient_plan': UpdateFolderMemberError._insufficient_plan_validator,
'no_permission': UpdateFolderMemberError._no_permission_validator,
'other': UpdateFolderMemberError._other_validator,
}
UpdateFolderMemberError.insufficient_plan = UpdateFolderMemberError('insufficient_plan')
UpdateFolderMemberError.no_permission = UpdateFolderMemberError('no_permission')
UpdateFolderMemberError.other = UpdateFolderMemberError('other')
UpdateFolderPolicyArg._shared_folder_id_validator = common.SharedFolderId_validator
UpdateFolderPolicyArg._member_policy_validator = bv.Nullable(MemberPolicy_validator)
UpdateFolderPolicyArg._acl_update_policy_validator = bv.Nullable(AclUpdatePolicy_validator)
UpdateFolderPolicyArg._viewer_info_policy_validator = bv.Nullable(ViewerInfoPolicy_validator)
UpdateFolderPolicyArg._shared_link_policy_validator = bv.Nullable(SharedLinkPolicy_validator)
UpdateFolderPolicyArg._link_settings_validator = bv.Nullable(LinkSettings_validator)
UpdateFolderPolicyArg._actions_validator = bv.Nullable(bv.List(FolderAction_validator))
UpdateFolderPolicyArg._all_field_names_ = set([
'shared_folder_id',
'member_policy',
'acl_update_policy',
'viewer_info_policy',
'shared_link_policy',
'link_settings',
'actions',
])
UpdateFolderPolicyArg._all_fields_ = [
('shared_folder_id', UpdateFolderPolicyArg._shared_folder_id_validator),
('member_policy', UpdateFolderPolicyArg._member_policy_validator),
('acl_update_policy', UpdateFolderPolicyArg._acl_update_policy_validator),
('viewer_info_policy', UpdateFolderPolicyArg._viewer_info_policy_validator),
('shared_link_policy', UpdateFolderPolicyArg._shared_link_policy_validator),
('link_settings', UpdateFolderPolicyArg._link_settings_validator),
('actions', UpdateFolderPolicyArg._actions_validator),
]
UpdateFolderPolicyError._access_error_validator = SharedFolderAccessError_validator
UpdateFolderPolicyError._not_on_team_validator = bv.Void()
UpdateFolderPolicyError._team_policy_disallows_member_policy_validator = bv.Void()
UpdateFolderPolicyError._disallowed_shared_link_policy_validator = bv.Void()
UpdateFolderPolicyError._no_permission_validator = bv.Void()
UpdateFolderPolicyError._team_folder_validator = bv.Void()
UpdateFolderPolicyError._other_validator = bv.Void()
UpdateFolderPolicyError._tagmap = {
'access_error': UpdateFolderPolicyError._access_error_validator,
'not_on_team': UpdateFolderPolicyError._not_on_team_validator,
'team_policy_disallows_member_policy': UpdateFolderPolicyError._team_policy_disallows_member_policy_validator,
'disallowed_shared_link_policy': UpdateFolderPolicyError._disallowed_shared_link_policy_validator,
'no_permission': UpdateFolderPolicyError._no_permission_validator,
'team_folder': UpdateFolderPolicyError._team_folder_validator,
'other': UpdateFolderPolicyError._other_validator,
}
UpdateFolderPolicyError.not_on_team = UpdateFolderPolicyError('not_on_team')
UpdateFolderPolicyError.team_policy_disallows_member_policy = UpdateFolderPolicyError('team_policy_disallows_member_policy')
UpdateFolderPolicyError.disallowed_shared_link_policy = UpdateFolderPolicyError('disallowed_shared_link_policy')
UpdateFolderPolicyError.no_permission = UpdateFolderPolicyError('no_permission')
UpdateFolderPolicyError.team_folder = UpdateFolderPolicyError('team_folder')
UpdateFolderPolicyError.other = UpdateFolderPolicyError('other')
UserMembershipInfo._user_validator = UserInfo_validator
UserMembershipInfo._all_field_names_ = MembershipInfo._all_field_names_.union(set(['user']))
UserMembershipInfo._all_fields_ = MembershipInfo._all_fields_ + [('user', UserMembershipInfo._user_validator)]
UserFileMembershipInfo._time_last_seen_validator = bv.Nullable(common.DropboxTimestamp_validator)
2019-08-28 21:48:24 +02:00
UserFileMembershipInfo._platform_type_validator = bv.Nullable(seen_state.PlatformType_validator)
UserFileMembershipInfo._all_field_names_ = UserMembershipInfo._all_field_names_.union(set([
'time_last_seen',
'platform_type',
]))
UserFileMembershipInfo._all_fields_ = UserMembershipInfo._all_fields_ + [
('time_last_seen', UserFileMembershipInfo._time_last_seen_validator),
('platform_type', UserFileMembershipInfo._platform_type_validator),
]
UserInfo._account_id_validator = users_common.AccountId_validator
2019-08-28 21:48:24 +02:00
UserInfo._email_validator = bv.String()
UserInfo._display_name_validator = bv.String()
UserInfo._same_team_validator = bv.Boolean()
UserInfo._team_member_id_validator = bv.Nullable(bv.String())
UserInfo._all_field_names_ = set([
'account_id',
2019-08-28 21:48:24 +02:00
'email',
'display_name',
'same_team',
'team_member_id',
])
UserInfo._all_fields_ = [
('account_id', UserInfo._account_id_validator),
2019-08-28 21:48:24 +02:00
('email', UserInfo._email_validator),
('display_name', UserInfo._display_name_validator),
('same_team', UserInfo._same_team_validator),
('team_member_id', UserInfo._team_member_id_validator),
]
ViewerInfoPolicy._enabled_validator = bv.Void()
ViewerInfoPolicy._disabled_validator = bv.Void()
ViewerInfoPolicy._other_validator = bv.Void()
ViewerInfoPolicy._tagmap = {
'enabled': ViewerInfoPolicy._enabled_validator,
'disabled': ViewerInfoPolicy._disabled_validator,
'other': ViewerInfoPolicy._other_validator,
}
ViewerInfoPolicy.enabled = ViewerInfoPolicy('enabled')
ViewerInfoPolicy.disabled = ViewerInfoPolicy('disabled')
ViewerInfoPolicy.other = ViewerInfoPolicy('other')
Visibility._public_validator = bv.Void()
Visibility._team_only_validator = bv.Void()
Visibility._password_validator = bv.Void()
Visibility._team_and_password_validator = bv.Void()
Visibility._shared_folder_only_validator = bv.Void()
Visibility._other_validator = bv.Void()
Visibility._tagmap = {
'public': Visibility._public_validator,
'team_only': Visibility._team_only_validator,
'password': Visibility._password_validator,
'team_and_password': Visibility._team_and_password_validator,
'shared_folder_only': Visibility._shared_folder_only_validator,
'other': Visibility._other_validator,
}
Visibility.public = Visibility('public')
Visibility.team_only = Visibility('team_only')
Visibility.password = Visibility('password')
Visibility.team_and_password = Visibility('team_and_password')
Visibility.shared_folder_only = Visibility('shared_folder_only')
Visibility.other = Visibility('other')
add_file_member = bb.Route(
'add_file_member',
2019-08-28 21:48:24 +02:00
1,
False,
AddFileMemberArgs_validator,
bv.List(FileMemberActionResult_validator),
AddFileMemberError_validator,
{'host': u'api',
'style': u'rpc'},
)
add_folder_member = bb.Route(
'add_folder_member',
2019-08-28 21:48:24 +02:00
1,
False,
AddFolderMemberArg_validator,
bv.Void(),
AddFolderMemberError_validator,
{'host': u'api',
'style': u'rpc'},
)
change_file_member_access = bb.Route(
'change_file_member_access',
2019-08-28 21:48:24 +02:00
1,
True,
ChangeFileMemberAccessArgs_validator,
FileMemberActionResult_validator,
FileMemberActionError_validator,
{'host': u'api',
'style': u'rpc'},
)
check_job_status = bb.Route(
'check_job_status',
2019-08-28 21:48:24 +02:00
1,
False,
2019-08-28 21:48:24 +02:00
async_.PollArg_validator,
JobStatus_validator,
2019-08-28 21:48:24 +02:00
async_.PollError_validator,
{'host': u'api',
'style': u'rpc'},
)
check_remove_member_job_status = bb.Route(
'check_remove_member_job_status',
2019-08-28 21:48:24 +02:00
1,
False,
2019-08-28 21:48:24 +02:00
async_.PollArg_validator,
RemoveMemberJobStatus_validator,
2019-08-28 21:48:24 +02:00
async_.PollError_validator,
{'host': u'api',
'style': u'rpc'},
)
check_share_job_status = bb.Route(
'check_share_job_status',
2019-08-28 21:48:24 +02:00
1,
False,
2019-08-28 21:48:24 +02:00
async_.PollArg_validator,
ShareFolderJobStatus_validator,
2019-08-28 21:48:24 +02:00
async_.PollError_validator,
{'host': u'api',
'style': u'rpc'},
)
create_shared_link = bb.Route(
'create_shared_link',
2019-08-28 21:48:24 +02:00
1,
True,
CreateSharedLinkArg_validator,
PathLinkMetadata_validator,
CreateSharedLinkError_validator,
{'host': u'api',
'style': u'rpc'},
)
create_shared_link_with_settings = bb.Route(
'create_shared_link_with_settings',
2019-08-28 21:48:24 +02:00
1,
False,
CreateSharedLinkWithSettingsArg_validator,
SharedLinkMetadata_validator,
CreateSharedLinkWithSettingsError_validator,
{'host': u'api',
'style': u'rpc'},
)
get_file_metadata = bb.Route(
'get_file_metadata',
2019-08-28 21:48:24 +02:00
1,
False,
GetFileMetadataArg_validator,
SharedFileMetadata_validator,
GetFileMetadataError_validator,
{'host': u'api',
'style': u'rpc'},
)
get_file_metadata_batch = bb.Route(
'get_file_metadata/batch',
2019-08-28 21:48:24 +02:00
1,
False,
GetFileMetadataBatchArg_validator,
bv.List(GetFileMetadataBatchResult_validator),
SharingUserError_validator,
{'host': u'api',
'style': u'rpc'},
)
get_folder_metadata = bb.Route(
'get_folder_metadata',
2019-08-28 21:48:24 +02:00
1,
False,
GetMetadataArgs_validator,
SharedFolderMetadata_validator,
SharedFolderAccessError_validator,
{'host': u'api',
'style': u'rpc'},
)
get_shared_link_file = bb.Route(
'get_shared_link_file',
2019-08-28 21:48:24 +02:00
1,
False,
GetSharedLinkFileArg_validator,
SharedLinkMetadata_validator,
GetSharedLinkFileError_validator,
{'host': u'content',
'style': u'download'},
)
get_shared_link_metadata = bb.Route(
'get_shared_link_metadata',
2019-08-28 21:48:24 +02:00
1,
False,
GetSharedLinkMetadataArg_validator,
SharedLinkMetadata_validator,
SharedLinkError_validator,
{'host': u'api',
'style': u'rpc'},
)
get_shared_links = bb.Route(
'get_shared_links',
2019-08-28 21:48:24 +02:00
1,
True,
GetSharedLinksArg_validator,
GetSharedLinksResult_validator,
GetSharedLinksError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_file_members = bb.Route(
'list_file_members',
2019-08-28 21:48:24 +02:00
1,
False,
ListFileMembersArg_validator,
SharedFileMembers_validator,
ListFileMembersError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_file_members_batch = bb.Route(
'list_file_members/batch',
2019-08-28 21:48:24 +02:00
1,
False,
ListFileMembersBatchArg_validator,
bv.List(ListFileMembersBatchResult_validator),
SharingUserError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_file_members_continue = bb.Route(
'list_file_members/continue',
2019-08-28 21:48:24 +02:00
1,
False,
ListFileMembersContinueArg_validator,
SharedFileMembers_validator,
ListFileMembersContinueError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_folder_members = bb.Route(
'list_folder_members',
2019-08-28 21:48:24 +02:00
1,
False,
ListFolderMembersArgs_validator,
SharedFolderMembers_validator,
SharedFolderAccessError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_folder_members_continue = bb.Route(
'list_folder_members/continue',
2019-08-28 21:48:24 +02:00
1,
False,
ListFolderMembersContinueArg_validator,
SharedFolderMembers_validator,
ListFolderMembersContinueError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_folders = bb.Route(
'list_folders',
2019-08-28 21:48:24 +02:00
1,
False,
ListFoldersArgs_validator,
ListFoldersResult_validator,
bv.Void(),
{'host': u'api',
'style': u'rpc'},
)
list_folders_continue = bb.Route(
'list_folders/continue',
2019-08-28 21:48:24 +02:00
1,
False,
ListFoldersContinueArg_validator,
ListFoldersResult_validator,
ListFoldersContinueError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_mountable_folders = bb.Route(
'list_mountable_folders',
2019-08-28 21:48:24 +02:00
1,
False,
ListFoldersArgs_validator,
ListFoldersResult_validator,
bv.Void(),
{'host': u'api',
'style': u'rpc'},
)
list_mountable_folders_continue = bb.Route(
'list_mountable_folders/continue',
2019-08-28 21:48:24 +02:00
1,
False,
ListFoldersContinueArg_validator,
ListFoldersResult_validator,
ListFoldersContinueError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_received_files = bb.Route(
'list_received_files',
2019-08-28 21:48:24 +02:00
1,
False,
ListFilesArg_validator,
ListFilesResult_validator,
SharingUserError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_received_files_continue = bb.Route(
'list_received_files/continue',
2019-08-28 21:48:24 +02:00
1,
False,
ListFilesContinueArg_validator,
ListFilesResult_validator,
ListFilesContinueError_validator,
{'host': u'api',
'style': u'rpc'},
)
list_shared_links = bb.Route(
'list_shared_links',
2019-08-28 21:48:24 +02:00
1,
False,
ListSharedLinksArg_validator,
ListSharedLinksResult_validator,
ListSharedLinksError_validator,
{'host': u'api',
'style': u'rpc'},
)
modify_shared_link_settings = bb.Route(
'modify_shared_link_settings',
2019-08-28 21:48:24 +02:00
1,
False,
ModifySharedLinkSettingsArgs_validator,
SharedLinkMetadata_validator,
ModifySharedLinkSettingsError_validator,
{'host': u'api',
'style': u'rpc'},
)
mount_folder = bb.Route(
'mount_folder',
2019-08-28 21:48:24 +02:00
1,
False,
MountFolderArg_validator,
SharedFolderMetadata_validator,
MountFolderError_validator,
{'host': u'api',
'style': u'rpc'},
)
relinquish_file_membership = bb.Route(
'relinquish_file_membership',
2019-08-28 21:48:24 +02:00
1,
False,
RelinquishFileMembershipArg_validator,
bv.Void(),
RelinquishFileMembershipError_validator,
{'host': u'api',
'style': u'rpc'},
)
relinquish_folder_membership = bb.Route(
'relinquish_folder_membership',
2019-08-28 21:48:24 +02:00
1,
False,
RelinquishFolderMembershipArg_validator,
2019-08-28 21:48:24 +02:00
async_.LaunchEmptyResult_validator,
RelinquishFolderMembershipError_validator,
{'host': u'api',
'style': u'rpc'},
)
remove_file_member = bb.Route(
'remove_file_member',
2019-08-28 21:48:24 +02:00
1,
True,
RemoveFileMemberArg_validator,
FileMemberActionIndividualResult_validator,
RemoveFileMemberError_validator,
{'host': u'api',
'style': u'rpc'},
)
remove_file_member_2 = bb.Route(
'remove_file_member_2',
2019-08-28 21:48:24 +02:00
1,
False,
RemoveFileMemberArg_validator,
FileMemberRemoveActionResult_validator,
RemoveFileMemberError_validator,
{'host': u'api',
'style': u'rpc'},
)
remove_folder_member = bb.Route(
'remove_folder_member',
2019-08-28 21:48:24 +02:00
1,
False,
RemoveFolderMemberArg_validator,
2019-08-28 21:48:24 +02:00
async_.LaunchResultBase_validator,
RemoveFolderMemberError_validator,
{'host': u'api',
'style': u'rpc'},
)
revoke_shared_link = bb.Route(
'revoke_shared_link',
2019-08-28 21:48:24 +02:00
1,
False,
RevokeSharedLinkArg_validator,
bv.Void(),
RevokeSharedLinkError_validator,
{'host': u'api',
'style': u'rpc'},
)
2019-08-28 21:48:24 +02:00
set_access_inheritance = bb.Route(
'set_access_inheritance',
1,
False,
SetAccessInheritanceArg_validator,
ShareFolderLaunch_validator,
SetAccessInheritanceError_validator,
{'host': u'api',
'style': u'rpc'},
)
share_folder = bb.Route(
'share_folder',
2019-08-28 21:48:24 +02:00
1,
False,
ShareFolderArg_validator,
ShareFolderLaunch_validator,
ShareFolderError_validator,
{'host': u'api',
'style': u'rpc'},
)
transfer_folder = bb.Route(
'transfer_folder',
2019-08-28 21:48:24 +02:00
1,
False,
TransferFolderArg_validator,
bv.Void(),
TransferFolderError_validator,
{'host': u'api',
'style': u'rpc'},
)
unmount_folder = bb.Route(
'unmount_folder',
2019-08-28 21:48:24 +02:00
1,
False,
UnmountFolderArg_validator,
bv.Void(),
UnmountFolderError_validator,
{'host': u'api',
'style': u'rpc'},
)
unshare_file = bb.Route(
'unshare_file',
2019-08-28 21:48:24 +02:00
1,
False,
UnshareFileArg_validator,
bv.Void(),
UnshareFileError_validator,
{'host': u'api',
'style': u'rpc'},
)
unshare_folder = bb.Route(
'unshare_folder',
2019-08-28 21:48:24 +02:00
1,
False,
UnshareFolderArg_validator,
2019-08-28 21:48:24 +02:00
async_.LaunchEmptyResult_validator,
UnshareFolderError_validator,
{'host': u'api',
'style': u'rpc'},
)
update_file_member = bb.Route(
'update_file_member',
2019-08-28 21:48:24 +02:00
1,
False,
UpdateFileMemberArgs_validator,
MemberAccessLevelResult_validator,
FileMemberActionError_validator,
{'host': u'api',
'style': u'rpc'},
)
update_folder_member = bb.Route(
'update_folder_member',
2019-08-28 21:48:24 +02:00
1,
False,
UpdateFolderMemberArg_validator,
MemberAccessLevelResult_validator,
UpdateFolderMemberError_validator,
{'host': u'api',
'style': u'rpc'},
)
update_folder_policy = bb.Route(
'update_folder_policy',
2019-08-28 21:48:24 +02:00
1,
False,
UpdateFolderPolicyArg_validator,
SharedFolderMetadata_validator,
UpdateFolderPolicyError_validator,
{'host': u'api',
'style': u'rpc'},
)
ROUTES = {
'add_file_member': add_file_member,
'add_folder_member': add_folder_member,
'change_file_member_access': change_file_member_access,
'check_job_status': check_job_status,
'check_remove_member_job_status': check_remove_member_job_status,
'check_share_job_status': check_share_job_status,
'create_shared_link': create_shared_link,
'create_shared_link_with_settings': create_shared_link_with_settings,
'get_file_metadata': get_file_metadata,
'get_file_metadata/batch': get_file_metadata_batch,
'get_folder_metadata': get_folder_metadata,
'get_shared_link_file': get_shared_link_file,
'get_shared_link_metadata': get_shared_link_metadata,
'get_shared_links': get_shared_links,
'list_file_members': list_file_members,
'list_file_members/batch': list_file_members_batch,
'list_file_members/continue': list_file_members_continue,
'list_folder_members': list_folder_members,
'list_folder_members/continue': list_folder_members_continue,
'list_folders': list_folders,
'list_folders/continue': list_folders_continue,
'list_mountable_folders': list_mountable_folders,
'list_mountable_folders/continue': list_mountable_folders_continue,
'list_received_files': list_received_files,
'list_received_files/continue': list_received_files_continue,
'list_shared_links': list_shared_links,
'modify_shared_link_settings': modify_shared_link_settings,
'mount_folder': mount_folder,
'relinquish_file_membership': relinquish_file_membership,
'relinquish_folder_membership': relinquish_folder_membership,
'remove_file_member': remove_file_member,
'remove_file_member_2': remove_file_member_2,
'remove_folder_member': remove_folder_member,
'revoke_shared_link': revoke_shared_link,
2019-08-28 21:48:24 +02:00
'set_access_inheritance': set_access_inheritance,
'share_folder': share_folder,
'transfer_folder': transfer_folder,
'unmount_folder': unmount_folder,
'unshare_file': unshare_file,
'unshare_folder': unshare_folder,
'update_file_member': update_file_member,
'update_folder_member': update_folder_member,
'update_folder_policy': update_folder_policy,
}