file_properties.py 108 KB
Newer Older
1 2
# -*- coding: utf-8 -*-
# Auto-generated by Stone, do not modify.
3
# @generated
4 5 6 7 8 9 10 11 12 13 14 15 16 17
# flake8: noqa
# pylint: skip-file
"""
This namespace contains helpers for property and template metadata endpoints.

These endpoints enable you to tag arbitrary key/value data to Dropbox files.

The most basic unit in this namespace is the :type:`PropertyField`. These fields encapsulate the actual key/value data.

Fields are added to a Dropbox file using a :type:`PropertyGroup`. Property groups contain a reference to a Dropbox file and a :type:`PropertyGroupTemplate`. Property groups are uniquely identified by the combination of their associated Dropbox file and template.

The :type:`PropertyGroupTemplate` is a way of restricting the possible key names and value types of the data within a property group. The possible key names and value types are explicitly enumerated using :type:`PropertyFieldTemplate` objects.

You can think of a property group template as a class definition for a particular key/value metadata object, and the property groups themselves as the instantiations of these objects.
18 19 20

Templates are owned either by a user/app pair or team/app pair. Templates and their associated properties can't be accessed by any app other than the app that created them, and even then, only when the app is linked with the owner of the template (either a user or team).

21
User-owned templates are accessed via the user-auth file_properties/templates/*_for_user endpoints, while team-owned templates are accessed via the team-auth file_properties/templates/*_for_team endpoints. Properties associated with either type of template can be accessed via the user-auth properties/* endpoints.
22 23

Finally, properties can be accessed from a number of endpoints that return metadata, including `files/get_metadata`, and `files/list_folder`. Properties can also be added during upload, using `files/upload`.
24 25 26 27 28
"""

try:
    from . import stone_validators as bv
    from . import stone_base as bb
29
except (ImportError, SystemError, ValueError):
30 31 32 33 34
    # 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

35
class AddPropertiesArg(bb.Struct):
36
    """
37 38 39 40
    :ivar file_properties.AddPropertiesArg.path: A unique identifier for the
        file or folder.
    :ivar file_properties.AddPropertiesArg.property_groups: The property groups
        which are to be added to a Dropbox file.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    """

    __slots__ = [
        '_path_value',
        '_path_present',
        '_property_groups_value',
        '_property_groups_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 path=None,
                 property_groups=None):
        self._path_value = None
        self._path_present = False
        self._property_groups_value = None
        self._property_groups_present = False
        if path is not None:
            self.path = path
        if property_groups is not None:
            self.property_groups = property_groups

    @property
    def path(self):
        """
        A unique identifier for the file or folder.

        :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 property_groups(self):
        """
        The property groups which are to be added to a Dropbox file.

        :rtype: list of [PropertyGroup]
        """
        if self._property_groups_present:
            return self._property_groups_value
        else:
            raise AttributeError("missing required field 'property_groups'")

    @property_groups.setter
    def property_groups(self, val):
        val = self._property_groups_validator.validate(val)
        self._property_groups_value = val
        self._property_groups_present = True

    @property_groups.deleter
    def property_groups(self):
        self._property_groups_value = None
        self._property_groups_present = False

110 111
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(AddPropertiesArg, self)._process_custom_annotations(annotation_type, field_path, processor)
112

113 114 115 116 117 118 119 120 121 122 123 124 125 126
    def __repr__(self):
        return 'AddPropertiesArg(path={!r}, property_groups={!r})'.format(
            self._path_value,
            self._property_groups_value,
        )

AddPropertiesArg_validator = bv.Struct(AddPropertiesArg)

class TemplateError(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.

127 128 129 130
    :ivar str file_properties.TemplateError.template_not_found: Template does
        not exist for the given identifier.
    :ivar file_properties.TemplateError.restricted_content: You do not have
        permission to modify this template.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    restricted_content = None
    # Attribute is overwritten below the class definition
    other = None

    @classmethod
    def template_not_found(cls, val):
        """
        Create an instance of this class set to the ``template_not_found`` tag
        with value ``val``.

        :param str val:
        :rtype: TemplateError
        """
        return cls('template_not_found', val)

    def is_template_not_found(self):
        """
        Check if the union tag is ``template_not_found``.

        :rtype: bool
        """
        return self._tag == 'template_not_found'

    def is_restricted_content(self):
        """
        Check if the union tag is ``restricted_content``.

        :rtype: bool
        """
        return self._tag == 'restricted_content'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def get_template_not_found(self):
        """
        Template does not exist for the given identifier.

        Only call this if :meth:`is_template_not_found` is true.

        :rtype: str
        """
        if not self.is_template_not_found():
            raise AttributeError("tag 'template_not_found' not set")
        return self._value

186 187
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(TemplateError, self)._process_custom_annotations(annotation_type, field_path, processor)
188

189 190 191 192 193 194 195 196 197 198 199
    def __repr__(self):
        return 'TemplateError(%r, %r)' % (self._tag, self._value)

TemplateError_validator = bv.Union(TemplateError)

class PropertiesError(TemplateError):
    """
    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.

200 201
    :ivar file_properties.PropertiesError.unsupported_folder: This folder cannot
        be tagged. Tagging folders is not supported for team-owned templates.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
    """

    # Attribute is overwritten below the class definition
    unsupported_folder = None

    @classmethod
    def path(cls, val):
        """
        Create an instance of this class set to the ``path`` tag with value
        ``val``.

        :param LookupError val:
        :rtype: PropertiesError
        """
        return cls('path', val)

    def is_path(self):
        """
        Check if the union tag is ``path``.

        :rtype: bool
        """
        return self._tag == 'path'

    def is_unsupported_folder(self):
        """
        Check if the union tag is ``unsupported_folder``.

        :rtype: bool
        """
        return self._tag == 'unsupported_folder'

    def get_path(self):
        """
        Only call this if :meth:`is_path` is true.

        :rtype: LookupError
        """
        if not self.is_path():
            raise AttributeError("tag 'path' not set")
        return self._value

244 245
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
246

247 248 249 250 251 252 253 254 255 256 257
    def __repr__(self):
        return 'PropertiesError(%r, %r)' % (self._tag, self._value)

PropertiesError_validator = bv.Union(PropertiesError)

class InvalidPropertyGroupError(PropertiesError):
    """
    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.

258 259 260 261 262
    :ivar file_properties.InvalidPropertyGroupError.property_field_too_large:
        One or more of the supplied property field values is too large.
    :ivar file_properties.InvalidPropertyGroupError.does_not_fit_template: One
        or more of the supplied property fields does not conform to the template
        specifications.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
    """

    # Attribute is overwritten below the class definition
    property_field_too_large = None
    # Attribute is overwritten below the class definition
    does_not_fit_template = None

    def is_property_field_too_large(self):
        """
        Check if the union tag is ``property_field_too_large``.

        :rtype: bool
        """
        return self._tag == 'property_field_too_large'

    def is_does_not_fit_template(self):
        """
        Check if the union tag is ``does_not_fit_template``.

        :rtype: bool
        """
        return self._tag == 'does_not_fit_template'

286 287
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(InvalidPropertyGroupError, self)._process_custom_annotations(annotation_type, field_path, processor)
288

289 290 291 292 293 294 295 296 297 298 299
    def __repr__(self):
        return 'InvalidPropertyGroupError(%r, %r)' % (self._tag, self._value)

InvalidPropertyGroupError_validator = bv.Union(InvalidPropertyGroupError)

class AddPropertiesError(InvalidPropertyGroupError):
    """
    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.

300 301
    :ivar file_properties.AddPropertiesError.property_group_already_exists: A
        property group associated with this template and file already exists.
302 303 304 305 306 307 308 309 310 311 312 313 314
    """

    # Attribute is overwritten below the class definition
    property_group_already_exists = None

    def is_property_group_already_exists(self):
        """
        Check if the union tag is ``property_group_already_exists``.

        :rtype: bool
        """
        return self._tag == 'property_group_already_exists'

315 316
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(AddPropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
317

318 319 320 321 322
    def __repr__(self):
        return 'AddPropertiesError(%r, %r)' % (self._tag, self._value)

AddPropertiesError_validator = bv.Union(AddPropertiesError)

323
class PropertyGroupTemplate(bb.Struct):
324 325 326
    """
    Defines how a property group may be structured.

327 328 329 330 331 332 333
    :ivar file_properties.PropertyGroupTemplate.name: Display name for the
        template. Template names can be up to 256 bytes.
    :ivar file_properties.PropertyGroupTemplate.description: Description for the
        template. Template descriptions can be up to 1024 bytes.
    :ivar file_properties.PropertyGroupTemplate.fields: Definitions of the
        property fields associated with this template. There can be up to 32
        properties in a single template.
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
    """

    __slots__ = [
        '_name_value',
        '_name_present',
        '_description_value',
        '_description_present',
        '_fields_value',
        '_fields_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 name=None,
                 description=None,
                 fields=None):
        self._name_value = None
        self._name_present = False
        self._description_value = None
        self._description_present = False
        self._fields_value = None
        self._fields_present = False
        if name is not None:
            self.name = name
        if description is not None:
            self.description = description
        if fields is not None:
            self.fields = fields

    @property
    def name(self):
        """
        Display name for the template. Template names can be up to 256 bytes.

        :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 description(self):
        """
        Description for the template. Template descriptions can be up to 1024
        bytes.

        :rtype: str
        """
        if self._description_present:
            return self._description_value
        else:
            raise AttributeError("missing required field 'description'")

    @description.setter
    def description(self, val):
        val = self._description_validator.validate(val)
        self._description_value = val
        self._description_present = True

    @description.deleter
    def description(self):
        self._description_value = None
        self._description_present = False

    @property
    def fields(self):
        """
        Definitions of the property fields associated with this template. There
        can be up to 32 properties in a single template.

        :rtype: list of [PropertyFieldTemplate]
        """
        if self._fields_present:
            return self._fields_value
        else:
            raise AttributeError("missing required field 'fields'")

    @fields.setter
    def fields(self, val):
        val = self._fields_validator.validate(val)
        self._fields_value = val
        self._fields_present = True

    @fields.deleter
    def fields(self):
        self._fields_value = None
        self._fields_present = False

435 436
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertyGroupTemplate, self)._process_custom_annotations(annotation_type, field_path, processor)
437

438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
    def __repr__(self):
        return 'PropertyGroupTemplate(name={!r}, description={!r}, fields={!r})'.format(
            self._name_value,
            self._description_value,
            self._fields_value,
        )

PropertyGroupTemplate_validator = bv.Struct(PropertyGroupTemplate)

class AddTemplateArg(PropertyGroupTemplate):

    __slots__ = [
    ]

    _has_required_fields = True

    def __init__(self,
                 name=None,
                 description=None,
                 fields=None):
        super(AddTemplateArg, self).__init__(name,
                                             description,
                                             fields)

462 463
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(AddTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
464

465 466 467 468 469 470 471 472 473
    def __repr__(self):
        return 'AddTemplateArg(name={!r}, description={!r}, fields={!r})'.format(
            self._name_value,
            self._description_value,
            self._fields_value,
        )

AddTemplateArg_validator = bv.Struct(AddTemplateArg)

474
class AddTemplateResult(bb.Struct):
475
    """
476 477
    :ivar file_properties.AddTemplateResult.template_id: An identifier for
        template added by  See
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.
    """

    __slots__ = [
        '_template_id_value',
        '_template_id_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 template_id=None):
        self._template_id_value = None
        self._template_id_present = False
        if template_id is not None:
            self.template_id = template_id

    @property
    def template_id(self):
        """
        An identifier for template added by  See
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.

        :rtype: str
        """
        if self._template_id_present:
            return self._template_id_value
        else:
            raise AttributeError("missing required field 'template_id'")

    @template_id.setter
    def template_id(self, val):
        val = self._template_id_validator.validate(val)
        self._template_id_value = val
        self._template_id_present = True

    @template_id.deleter
    def template_id(self):
        self._template_id_value = None
        self._template_id_present = False

523 524
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(AddTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
525

526 527 528 529 530 531 532
    def __repr__(self):
        return 'AddTemplateResult(template_id={!r})'.format(
            self._template_id_value,
        )

AddTemplateResult_validator = bv.Struct(AddTemplateResult)

533
class GetTemplateArg(bb.Struct):
534
    """
535 536
    :ivar file_properties.GetTemplateArg.template_id: An identifier for template
        added by route  See
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.
    """

    __slots__ = [
        '_template_id_value',
        '_template_id_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 template_id=None):
        self._template_id_value = None
        self._template_id_present = False
        if template_id is not None:
            self.template_id = template_id

    @property
    def template_id(self):
        """
        An identifier for template added by route  See
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.

        :rtype: str
        """
        if self._template_id_present:
            return self._template_id_value
        else:
            raise AttributeError("missing required field 'template_id'")

    @template_id.setter
    def template_id(self, val):
        val = self._template_id_validator.validate(val)
        self._template_id_value = val
        self._template_id_present = True

    @template_id.deleter
    def template_id(self):
        self._template_id_value = None
        self._template_id_present = False

582 583
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(GetTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
584

585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
    def __repr__(self):
        return 'GetTemplateArg(template_id={!r})'.format(
            self._template_id_value,
        )

GetTemplateArg_validator = bv.Struct(GetTemplateArg)

class GetTemplateResult(PropertyGroupTemplate):

    __slots__ = [
    ]

    _has_required_fields = True

    def __init__(self,
                 name=None,
                 description=None,
                 fields=None):
        super(GetTemplateResult, self).__init__(name,
                                                description,
                                                fields)

607 608
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(GetTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
609

610 611 612 613 614 615 616 617 618
    def __repr__(self):
        return 'GetTemplateResult(name={!r}, description={!r}, fields={!r})'.format(
            self._name_value,
            self._description_value,
            self._fields_value,
        )

GetTemplateResult_validator = bv.Struct(GetTemplateResult)

619
class ListTemplateResult(bb.Struct):
620
    """
621 622
    :ivar file_properties.ListTemplateResult.template_ids: List of identifiers
        for templates added by  See
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.
    """

    __slots__ = [
        '_template_ids_value',
        '_template_ids_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 template_ids=None):
        self._template_ids_value = None
        self._template_ids_present = False
        if template_ids is not None:
            self.template_ids = template_ids

    @property
    def template_ids(self):
        """
        List of identifiers for templates added by  See
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.

        :rtype: list of [str]
        """
        if self._template_ids_present:
            return self._template_ids_value
        else:
            raise AttributeError("missing required field 'template_ids'")

    @template_ids.setter
    def template_ids(self, val):
        val = self._template_ids_validator.validate(val)
        self._template_ids_value = val
        self._template_ids_present = True

    @template_ids.deleter
    def template_ids(self):
        self._template_ids_value = None
        self._template_ids_present = False

668 669
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(ListTemplateResult, self)._process_custom_annotations(annotation_type, field_path, processor)
670

671 672 673 674 675 676 677 678 679 680 681 682 683 684 685
    def __repr__(self):
        return 'ListTemplateResult(template_ids={!r})'.format(
            self._template_ids_value,
        )

ListTemplateResult_validator = bv.Struct(ListTemplateResult)

class LogicalOperator(bb.Union):
    """
    Logical operator to join search queries together.

    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.

686 687
    :ivar file_properties.LogicalOperator.or_operator: Append a query with an
        "or" operator.
688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    or_operator = None
    # Attribute is overwritten below the class definition
    other = None

    def is_or_operator(self):
        """
        Check if the union tag is ``or_operator``.

        :rtype: bool
        """
        return self._tag == 'or_operator'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

712 713
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(LogicalOperator, self)._process_custom_annotations(annotation_type, field_path, processor)
714

715 716 717 718 719 720 721 722 723 724 725
    def __repr__(self):
        return 'LogicalOperator(%r, %r)' % (self._tag, self._value)

LogicalOperator_validator = bv.Union(LogicalOperator)

class LookUpPropertiesError(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.

726 727
    :ivar file_properties.LookUpPropertiesError.property_group_not_found: No
        property group was found.
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    property_group_not_found = None
    # Attribute is overwritten below the class definition
    other = None

    def is_property_group_not_found(self):
        """
        Check if the union tag is ``property_group_not_found``.

        :rtype: bool
        """
        return self._tag == 'property_group_not_found'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

752 753
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(LookUpPropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
754

755 756 757 758 759 760 761 762 763 764 765
    def __repr__(self):
        return 'LookUpPropertiesError(%r, %r)' % (self._tag, self._value)

LookUpPropertiesError_validator = bv.Union(LookUpPropertiesError)

class LookupError(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.

766 767 768 769 770 771 772 773 774
    :ivar file_properties.LookupError.not_found: There is nothing at the given
        path.
    :ivar file_properties.LookupError.not_file: We were expecting a file, but
        the given path refers to something that isn't a file.
    :ivar file_properties.LookupError.not_folder: We were expecting a folder,
        but the given path refers to something that isn't a folder.
    :ivar file_properties.LookupError.restricted_content: The file cannot be
        transferred because the content is restricted.  For example, sometimes
        there are legal restrictions due to copyright claims.
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    not_found = None
    # Attribute is overwritten below the class definition
    not_file = None
    # Attribute is overwritten below the class definition
    not_folder = None
    # Attribute is overwritten below the class definition
    restricted_content = None
    # Attribute is overwritten below the class definition
    other = None

    @classmethod
    def malformed_path(cls, val):
        """
        Create an instance of this class set to the ``malformed_path`` tag with
        value ``val``.

        :param str val:
        :rtype: LookupError
        """
        return cls('malformed_path', val)

    def is_malformed_path(self):
        """
        Check if the union tag is ``malformed_path``.

        :rtype: bool
        """
        return self._tag == 'malformed_path'

    def is_not_found(self):
        """
        Check if the union tag is ``not_found``.

        :rtype: bool
        """
        return self._tag == 'not_found'

    def is_not_file(self):
        """
        Check if the union tag is ``not_file``.

        :rtype: bool
        """
        return self._tag == 'not_file'

    def is_not_folder(self):
        """
        Check if the union tag is ``not_folder``.

        :rtype: bool
        """
        return self._tag == 'not_folder'

    def is_restricted_content(self):
        """
        Check if the union tag is ``restricted_content``.

        :rtype: bool
        """
        return self._tag == 'restricted_content'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def get_malformed_path(self):
        """
        Only call this if :meth:`is_malformed_path` is true.

        :rtype: str
        """
        if not self.is_malformed_path():
            raise AttributeError("tag 'malformed_path' not set")
        return self._value

858 859
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(LookupError, self)._process_custom_annotations(annotation_type, field_path, processor)
860

861 862 863 864 865 866 867 868 869 870 871
    def __repr__(self):
        return 'LookupError(%r, %r)' % (self._tag, self._value)

LookupError_validator = bv.Union(LookupError)

class ModifyTemplateError(TemplateError):
    """
    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.

872 873 874 875 876 877 878 879 880 881
    :ivar file_properties.ModifyTemplateError.conflicting_property_names: A
        property field key with that name already exists in the template.
    :ivar file_properties.ModifyTemplateError.too_many_properties: There are too
        many properties in the changed template. The maximum number of
        properties per template is 32.
    :ivar file_properties.ModifyTemplateError.too_many_templates: There are too
        many templates for the team.
    :ivar file_properties.ModifyTemplateError.template_attribute_too_large: The
        template name, description or one or more of the property field keys is
        too large.
882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924
    """

    # Attribute is overwritten below the class definition
    conflicting_property_names = None
    # Attribute is overwritten below the class definition
    too_many_properties = None
    # Attribute is overwritten below the class definition
    too_many_templates = None
    # Attribute is overwritten below the class definition
    template_attribute_too_large = None

    def is_conflicting_property_names(self):
        """
        Check if the union tag is ``conflicting_property_names``.

        :rtype: bool
        """
        return self._tag == 'conflicting_property_names'

    def is_too_many_properties(self):
        """
        Check if the union tag is ``too_many_properties``.

        :rtype: bool
        """
        return self._tag == 'too_many_properties'

    def is_too_many_templates(self):
        """
        Check if the union tag is ``too_many_templates``.

        :rtype: bool
        """
        return self._tag == 'too_many_templates'

    def is_template_attribute_too_large(self):
        """
        Check if the union tag is ``template_attribute_too_large``.

        :rtype: bool
        """
        return self._tag == 'template_attribute_too_large'

925 926
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(ModifyTemplateError, self)._process_custom_annotations(annotation_type, field_path, processor)
927

928 929 930 931 932
    def __repr__(self):
        return 'ModifyTemplateError(%r, %r)' % (self._tag, self._value)

ModifyTemplateError_validator = bv.Union(ModifyTemplateError)

933
class OverwritePropertyGroupArg(bb.Struct):
934
    """
935 936 937 938
    :ivar file_properties.OverwritePropertyGroupArg.path: A unique identifier
        for the file or folder.
    :ivar file_properties.OverwritePropertyGroupArg.property_groups: The
        property groups "snapshot" updates to force apply.
939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007
    """

    __slots__ = [
        '_path_value',
        '_path_present',
        '_property_groups_value',
        '_property_groups_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 path=None,
                 property_groups=None):
        self._path_value = None
        self._path_present = False
        self._property_groups_value = None
        self._property_groups_present = False
        if path is not None:
            self.path = path
        if property_groups is not None:
            self.property_groups = property_groups

    @property
    def path(self):
        """
        A unique identifier for the file or folder.

        :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 property_groups(self):
        """
        The property groups "snapshot" updates to force apply.

        :rtype: list of [PropertyGroup]
        """
        if self._property_groups_present:
            return self._property_groups_value
        else:
            raise AttributeError("missing required field 'property_groups'")

    @property_groups.setter
    def property_groups(self, val):
        val = self._property_groups_validator.validate(val)
        self._property_groups_value = val
        self._property_groups_present = True

    @property_groups.deleter
    def property_groups(self):
        self._property_groups_value = None
        self._property_groups_present = False

1008 1009
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(OverwritePropertyGroupArg, self)._process_custom_annotations(annotation_type, field_path, processor)
1010

1011 1012 1013 1014 1015 1016 1017 1018
    def __repr__(self):
        return 'OverwritePropertyGroupArg(path={!r}, property_groups={!r})'.format(
            self._path_value,
            self._property_groups_value,
        )

OverwritePropertyGroupArg_validator = bv.Struct(OverwritePropertyGroupArg)

1019
class PropertiesSearchArg(bb.Struct):
1020
    """
1021 1022 1023
    :ivar file_properties.PropertiesSearchArg.queries: Queries to search.
    :ivar file_properties.PropertiesSearchArg.template_filter: Filter results to
        contain only properties associated with these template IDs.
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
    """

    __slots__ = [
        '_queries_value',
        '_queries_present',
        '_template_filter_value',
        '_template_filter_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 queries=None,
                 template_filter=None):
        self._queries_value = None
        self._queries_present = False
        self._template_filter_value = None
        self._template_filter_present = False
        if queries is not None:
            self.queries = queries
        if template_filter is not None:
            self.template_filter = template_filter

    @property
    def queries(self):
        """
        Queries to search.

        :rtype: list of [PropertiesSearchQuery]
        """
        if self._queries_present:
            return self._queries_value
        else:
            raise AttributeError("missing required field 'queries'")

    @queries.setter
    def queries(self, val):
        val = self._queries_validator.validate(val)
        self._queries_value = val
        self._queries_present = True

    @queries.deleter
    def queries(self):
        self._queries_value = None
        self._queries_present = False

    @property
    def template_filter(self):
        """
        Filter results to contain only properties associated with these template
        IDs.

        :rtype: TemplateFilter
        """
        if self._template_filter_present:
            return self._template_filter_value
        else:
            return TemplateFilter.filter_none

    @template_filter.setter
    def template_filter(self, val):
        self._template_filter_validator.validate_type_only(val)
        self._template_filter_value = val
        self._template_filter_present = True

    @template_filter.deleter
    def template_filter(self):
        self._template_filter_value = None
        self._template_filter_present = False

1094 1095
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchArg, self)._process_custom_annotations(annotation_type, field_path, processor)
1096

1097 1098 1099 1100 1101 1102 1103 1104
    def __repr__(self):
        return 'PropertiesSearchArg(queries={!r}, template_filter={!r})'.format(
            self._queries_value,
            self._template_filter_value,
        )

PropertiesSearchArg_validator = bv.Struct(PropertiesSearchArg)

1105
class PropertiesSearchContinueArg(bb.Struct):
1106
    """
1107 1108
    :ivar file_properties.PropertiesSearchContinueArg.cursor: The cursor
        returned by your last call to
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151
        :meth:`dropbox.dropbox.Dropbox.file_properties_properties_search` or
        :meth:`dropbox.dropbox.Dropbox.file_properties_properties_search_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.file_properties_properties_search` or
        :meth:`dropbox.dropbox.Dropbox.file_properties_properties_search_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

1152 1153
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchContinueArg, self)._process_custom_annotations(annotation_type, field_path, processor)
1154

1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
    def __repr__(self):
        return 'PropertiesSearchContinueArg(cursor={!r})'.format(
            self._cursor_value,
        )

PropertiesSearchContinueArg_validator = bv.Struct(PropertiesSearchContinueArg)

class PropertiesSearchContinueError(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.

1168 1169
    :ivar file_properties.PropertiesSearchContinueError.reset: Indicates that
        the cursor has been invalidated. Call
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
        :meth:`dropbox.dropbox.Dropbox.file_properties_properties_search` 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

    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'

1196 1197
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchContinueError, self)._process_custom_annotations(annotation_type, field_path, processor)
1198

1199 1200 1201 1202 1203
    def __repr__(self):
        return 'PropertiesSearchContinueError(%r, %r)' % (self._tag, self._value)

PropertiesSearchContinueError_validator = bv.Union(PropertiesSearchContinueError)

1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251
class PropertiesSearchError(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 property_group_lookup(cls, val):
        """
        Create an instance of this class set to the ``property_group_lookup``
        tag with value ``val``.

        :param LookUpPropertiesError val:
        :rtype: PropertiesSearchError
        """
        return cls('property_group_lookup', val)

    def is_property_group_lookup(self):
        """
        Check if the union tag is ``property_group_lookup``.

        :rtype: bool
        """
        return self._tag == 'property_group_lookup'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def get_property_group_lookup(self):
        """
        Only call this if :meth:`is_property_group_lookup` is true.

        :rtype: LookUpPropertiesError
        """
        if not self.is_property_group_lookup():
            raise AttributeError("tag 'property_group_lookup' not set")
        return self._value

1252 1253
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchError, self)._process_custom_annotations(annotation_type, field_path, processor)
1254

1255 1256 1257 1258 1259
    def __repr__(self):
        return 'PropertiesSearchError(%r, %r)' % (self._tag, self._value)

PropertiesSearchError_validator = bv.Union(PropertiesSearchError)

1260
class PropertiesSearchMatch(bb.Struct):
1261
    """
1262 1263 1264 1265 1266 1267 1268 1269
    :ivar file_properties.PropertiesSearchMatch.id: The ID for the matched file
        or folder.
    :ivar file_properties.PropertiesSearchMatch.path: The path for the matched
        file or folder.
    :ivar file_properties.PropertiesSearchMatch.is_deleted: Whether the file or
        folder is deleted.
    :ivar file_properties.PropertiesSearchMatch.property_groups: List of custom
        property groups associated with the file.
1270 1271 1272 1273 1274 1275 1276
    """

    __slots__ = [
        '_id_value',
        '_id_present',
        '_path_value',
        '_path_present',
1277 1278
        '_is_deleted_value',
        '_is_deleted_present',
1279 1280 1281 1282 1283 1284 1285 1286 1287
        '_property_groups_value',
        '_property_groups_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 id=None,
                 path=None,
1288
                 is_deleted=None,
1289 1290 1291 1292 1293
                 property_groups=None):
        self._id_value = None
        self._id_present = False
        self._path_value = None
        self._path_present = False
1294 1295
        self._is_deleted_value = None
        self._is_deleted_present = False
1296 1297 1298 1299 1300 1301
        self._property_groups_value = None
        self._property_groups_present = False
        if id is not None:
            self.id = id
        if path is not None:
            self.path = path
1302 1303
        if is_deleted is not None:
            self.is_deleted = is_deleted
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352
        if property_groups is not None:
            self.property_groups = property_groups

    @property
    def id(self):
        """
        The ID for the matched file or folder.

        :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 path(self):
        """
        The path for the matched file or folder.

        :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

1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375
    @property
    def is_deleted(self):
        """
        Whether the file or folder is deleted.

        :rtype: bool
        """
        if self._is_deleted_present:
            return self._is_deleted_value
        else:
            raise AttributeError("missing required field 'is_deleted'")

    @is_deleted.setter
    def is_deleted(self, val):
        val = self._is_deleted_validator.validate(val)
        self._is_deleted_value = val
        self._is_deleted_present = True

    @is_deleted.deleter
    def is_deleted(self):
        self._is_deleted_value = None
        self._is_deleted_present = False

1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398
    @property
    def property_groups(self):
        """
        List of custom property groups associated with the file.

        :rtype: list of [PropertyGroup]
        """
        if self._property_groups_present:
            return self._property_groups_value
        else:
            raise AttributeError("missing required field 'property_groups'")

    @property_groups.setter
    def property_groups(self, val):
        val = self._property_groups_validator.validate(val)
        self._property_groups_value = val
        self._property_groups_present = True

    @property_groups.deleter
    def property_groups(self):
        self._property_groups_value = None
        self._property_groups_present = False

1399 1400
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchMatch, self)._process_custom_annotations(annotation_type, field_path, processor)
1401

1402
    def __repr__(self):
1403
        return 'PropertiesSearchMatch(id={!r}, path={!r}, is_deleted={!r}, property_groups={!r})'.format(
1404 1405
            self._id_value,
            self._path_value,
1406
            self._is_deleted_value,
1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417
            self._property_groups_value,
        )

PropertiesSearchMatch_validator = bv.Struct(PropertiesSearchMatch)

class PropertiesSearchMode(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.

1418 1419
    :ivar str file_properties.PropertiesSearchMode.field_name: Search for a
        value associated with this field name.
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    other = None

    @classmethod
    def field_name(cls, val):
        """
        Create an instance of this class set to the ``field_name`` tag with
        value ``val``.

        :param str val:
        :rtype: PropertiesSearchMode
        """
        return cls('field_name', val)

    def is_field_name(self):
        """
        Check if the union tag is ``field_name``.

        :rtype: bool
        """
        return self._tag == 'field_name'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def get_field_name(self):
        """
        Search for a value associated with this field name.

        Only call this if :meth:`is_field_name` is true.

        :rtype: str
        """
        if not self.is_field_name():
            raise AttributeError("tag 'field_name' not set")
        return self._value

1465 1466
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchMode, self)._process_custom_annotations(annotation_type, field_path, processor)
1467

1468 1469 1470 1471 1472
    def __repr__(self):
        return 'PropertiesSearchMode(%r, %r)' % (self._tag, self._value)

PropertiesSearchMode_validator = bv.Union(PropertiesSearchMode)

1473
class PropertiesSearchQuery(bb.Struct):
1474
    """
1475 1476 1477 1478 1479 1480
    :ivar file_properties.PropertiesSearchQuery.query: The property field value
        for which to search across templates.
    :ivar file_properties.PropertiesSearchQuery.mode: The mode with which to
        perform the search.
    :ivar file_properties.PropertiesSearchQuery.logical_operator: The logical
        operator with which to append the query.
1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579
    """

    __slots__ = [
        '_query_value',
        '_query_present',
        '_mode_value',
        '_mode_present',
        '_logical_operator_value',
        '_logical_operator_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 query=None,
                 mode=None,
                 logical_operator=None):
        self._query_value = None
        self._query_present = False
        self._mode_value = None
        self._mode_present = False
        self._logical_operator_value = None
        self._logical_operator_present = False
        if query is not None:
            self.query = query
        if mode is not None:
            self.mode = mode
        if logical_operator is not None:
            self.logical_operator = logical_operator

    @property
    def query(self):
        """
        The property field value for which to search across templates.

        :rtype: str
        """
        if self._query_present:
            return self._query_value
        else:
            raise AttributeError("missing required field 'query'")

    @query.setter
    def query(self, val):
        val = self._query_validator.validate(val)
        self._query_value = val
        self._query_present = True

    @query.deleter
    def query(self):
        self._query_value = None
        self._query_present = False

    @property
    def mode(self):
        """
        The mode with which to perform the search.

        :rtype: PropertiesSearchMode
        """
        if self._mode_present:
            return self._mode_value
        else:
            raise AttributeError("missing required field 'mode'")

    @mode.setter
    def mode(self, val):
        self._mode_validator.validate_type_only(val)
        self._mode_value = val
        self._mode_present = True

    @mode.deleter
    def mode(self):
        self._mode_value = None
        self._mode_present = False

    @property
    def logical_operator(self):
        """
        The logical operator with which to append the query.

        :rtype: LogicalOperator
        """
        if self._logical_operator_present:
            return self._logical_operator_value
        else:
            return LogicalOperator.or_operator

    @logical_operator.setter
    def logical_operator(self, val):
        self._logical_operator_validator.validate_type_only(val)
        self._logical_operator_value = val
        self._logical_operator_present = True

    @logical_operator.deleter
    def logical_operator(self):
        self._logical_operator_value = None
        self._logical_operator_present = False

1580 1581
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchQuery, self)._process_custom_annotations(annotation_type, field_path, processor)
1582

1583 1584 1585 1586 1587 1588 1589 1590 1591
    def __repr__(self):
        return 'PropertiesSearchQuery(query={!r}, mode={!r}, logical_operator={!r})'.format(
            self._query_value,
            self._mode_value,
            self._logical_operator_value,
        )

PropertiesSearchQuery_validator = bv.Struct(PropertiesSearchQuery)

1592
class PropertiesSearchResult(bb.Struct):
1593
    """
1594 1595 1596
    :ivar file_properties.PropertiesSearchResult.matches: A list (possibly
        empty) of matches for the query.
    :ivar file_properties.PropertiesSearchResult.cursor: Pass the cursor into
1597 1598 1599
        :meth:`dropbox.dropbox.Dropbox.file_properties_properties_search_continue`
        to continue to receive search results. Cursor will be null when there
        are no more results.
1600 1601 1602 1603 1604
    """

    __slots__ = [
        '_matches_value',
        '_matches_present',
1605 1606
        '_cursor_value',
        '_cursor_present',
1607 1608 1609 1610 1611
    ]

    _has_required_fields = True

    def __init__(self,
1612 1613
                 matches=None,
                 cursor=None):
1614 1615
        self._matches_value = None
        self._matches_present = False
1616 1617
        self._cursor_value = None
        self._cursor_present = False
1618 1619
        if matches is not None:
            self.matches = matches
1620 1621
        if cursor is not None:
            self.cursor = cursor
1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645

    @property
    def matches(self):
        """
        A list (possibly empty) of matches for the query.

        :rtype: list of [PropertiesSearchMatch]
        """
        if self._matches_present:
            return self._matches_value
        else:
            raise AttributeError("missing required field 'matches'")

    @matches.setter
    def matches(self, val):
        val = self._matches_validator.validate(val)
        self._matches_value = val
        self._matches_present = True

    @matches.deleter
    def matches(self):
        self._matches_value = None
        self._matches_present = False

1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674
    @property
    def cursor(self):
        """
        Pass the cursor into
        :meth:`dropbox.dropbox.Dropbox.file_properties_properties_search_continue`
        to continue to receive search results. Cursor will be null when there
        are no more results.

        :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

1675 1676
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertiesSearchResult, self)._process_custom_annotations(annotation_type, field_path, processor)
1677

1678
    def __repr__(self):
1679
        return 'PropertiesSearchResult(matches={!r}, cursor={!r})'.format(
1680
            self._matches_value,
1681
            self._cursor_value,
1682 1683 1684 1685
        )

PropertiesSearchResult_validator = bv.Struct(PropertiesSearchResult)

1686
class PropertyField(bb.Struct):
1687 1688 1689 1690
    """
    Raw key/value data to be associated with a Dropbox file. Property fields are
    added to Dropbox files as a :class:`PropertyGroup`.

1691 1692 1693 1694
    :ivar file_properties.PropertyField.name: Key of the property field
        associated with a file and template. Keys can be up to 256 bytes.
    :ivar file_properties.PropertyField.value: Value of the property field
        associated with a file and template. Values can be up to 1024 bytes.
1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765
    """

    __slots__ = [
        '_name_value',
        '_name_present',
        '_value_value',
        '_value_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 name=None,
                 value=None):
        self._name_value = None
        self._name_present = False
        self._value_value = None
        self._value_present = False
        if name is not None:
            self.name = name
        if value is not None:
            self.value = value

    @property
    def name(self):
        """
        Key of the property field associated with a file and template. Keys can
        be up to 256 bytes.

        :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 value(self):
        """
        Value of the property field associated with a file and template. Values
        can be up to 1024 bytes.

        :rtype: str
        """
        if self._value_present:
            return self._value_value
        else:
            raise AttributeError("missing required field 'value'")

    @value.setter
    def value(self, val):
        val = self._value_validator.validate(val)
        self._value_value = val
        self._value_present = True

    @value.deleter
    def value(self):
        self._value_value = None
        self._value_present = False

1766 1767
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertyField, self)._process_custom_annotations(annotation_type, field_path, processor)
1768

1769 1770 1771 1772 1773 1774 1775 1776
    def __repr__(self):
        return 'PropertyField(name={!r}, value={!r})'.format(
            self._name_value,
            self._value_value,
        )

PropertyField_validator = bv.Struct(PropertyField)

1777
class PropertyFieldTemplate(bb.Struct):
1778 1779 1780 1781
    """
    Defines how a single property field may be structured. Used exclusively by
    :class:`PropertyGroupTemplate`.

1782 1783 1784 1785 1786 1787 1788
    :ivar file_properties.PropertyFieldTemplate.name: Key of the property field
        being described. Property field keys can be up to 256 bytes.
    :ivar file_properties.PropertyFieldTemplate.description: Description of the
        property field. Property field descriptions can be up to 1024 bytes.
    :ivar file_properties.PropertyFieldTemplate.type: Data type of the value of
        this property field. This type will be enforced upon property creation
        and modifications.
1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890
    """

    __slots__ = [
        '_name_value',
        '_name_present',
        '_description_value',
        '_description_present',
        '_type_value',
        '_type_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 name=None,
                 description=None,
                 type=None):
        self._name_value = None
        self._name_present = False
        self._description_value = None
        self._description_present = False
        self._type_value = None
        self._type_present = False
        if name is not None:
            self.name = name
        if description is not None:
            self.description = description
        if type is not None:
            self.type = type

    @property
    def name(self):
        """
        Key of the property field being described. Property field keys can be up
        to 256 bytes.

        :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 description(self):
        """
        Description of the property field. Property field descriptions can be up
        to 1024 bytes.

        :rtype: str
        """
        if self._description_present:
            return self._description_value
        else:
            raise AttributeError("missing required field 'description'")

    @description.setter
    def description(self, val):
        val = self._description_validator.validate(val)
        self._description_value = val
        self._description_present = True

    @description.deleter
    def description(self):
        self._description_value = None
        self._description_present = False

    @property
    def type(self):
        """
        Data type of the value of this property field. This type will be
        enforced upon property creation and modifications.

        :rtype: PropertyType
        """
        if self._type_present:
            return self._type_value
        else:
            raise AttributeError("missing required field 'type'")

    @type.setter
    def type(self, val):
        self._type_validator.validate_type_only(val)
        self._type_value = val
        self._type_present = True

    @type.deleter
    def type(self):
        self._type_value = None
        self._type_present = False

1891 1892
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertyFieldTemplate, self)._process_custom_annotations(annotation_type, field_path, processor)
1893

1894 1895 1896 1897 1898 1899 1900 1901 1902
    def __repr__(self):
        return 'PropertyFieldTemplate(name={!r}, description={!r}, type={!r})'.format(
            self._name_value,
            self._description_value,
            self._type_value,
        )

PropertyFieldTemplate_validator = bv.Struct(PropertyFieldTemplate)

1903
class PropertyGroup(bb.Struct):
1904 1905 1906 1907 1908 1909
    """
    A subset of the property fields described by the corresponding
    :class:`PropertyGroupTemplate`. Properties are always added to a Dropbox
    file as a :class:`PropertyGroup`. The possible key names and value types in
    this group are defined by the corresponding :class:`PropertyGroupTemplate`.

1910 1911 1912 1913
    :ivar file_properties.PropertyGroup.template_id: A unique identifier for the
        associated template.
    :ivar file_properties.PropertyGroup.fields: The actual properties associated
        with the template. There can be up to 32 property types per template.
1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983
    """

    __slots__ = [
        '_template_id_value',
        '_template_id_present',
        '_fields_value',
        '_fields_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 template_id=None,
                 fields=None):
        self._template_id_value = None
        self._template_id_present = False
        self._fields_value = None
        self._fields_present = False
        if template_id is not None:
            self.template_id = template_id
        if fields is not None:
            self.fields = fields

    @property
    def template_id(self):
        """
        A unique identifier for the associated template.

        :rtype: str
        """
        if self._template_id_present:
            return self._template_id_value
        else:
            raise AttributeError("missing required field 'template_id'")

    @template_id.setter
    def template_id(self, val):
        val = self._template_id_validator.validate(val)
        self._template_id_value = val
        self._template_id_present = True

    @template_id.deleter
    def template_id(self):
        self._template_id_value = None
        self._template_id_present = False

    @property
    def fields(self):
        """
        The actual properties associated with the template. There can be up to
        32 property types per template.

        :rtype: list of [PropertyField]
        """
        if self._fields_present:
            return self._fields_value
        else:
            raise AttributeError("missing required field 'fields'")

    @fields.setter
    def fields(self, val):
        val = self._fields_validator.validate(val)
        self._fields_value = val
        self._fields_present = True

    @fields.deleter
    def fields(self):
        self._fields_value = None
        self._fields_present = False

1984 1985
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertyGroup, self)._process_custom_annotations(annotation_type, field_path, processor)
1986

1987 1988 1989 1990 1991 1992 1993 1994
    def __repr__(self):
        return 'PropertyGroup(template_id={!r}, fields={!r})'.format(
            self._template_id_value,
            self._fields_value,
        )

PropertyGroup_validator = bv.Struct(PropertyGroup)

1995
class PropertyGroupUpdate(bb.Struct):
1996
    """
1997 1998 1999 2000 2001 2002 2003
    :ivar file_properties.PropertyGroupUpdate.template_id: A unique identifier
        for a property template.
    :ivar file_properties.PropertyGroupUpdate.add_or_update_fields: Property
        fields to update. If the property field already exists, it is updated.
        If the property field doesn't exist, the property group is added.
    :ivar file_properties.PropertyGroupUpdate.remove_fields: Property fields to
        remove (by name), provided they exist.
2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110
    """

    __slots__ = [
        '_template_id_value',
        '_template_id_present',
        '_add_or_update_fields_value',
        '_add_or_update_fields_present',
        '_remove_fields_value',
        '_remove_fields_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 template_id=None,
                 add_or_update_fields=None,
                 remove_fields=None):
        self._template_id_value = None
        self._template_id_present = False
        self._add_or_update_fields_value = None
        self._add_or_update_fields_present = False
        self._remove_fields_value = None
        self._remove_fields_present = False
        if template_id is not None:
            self.template_id = template_id
        if add_or_update_fields is not None:
            self.add_or_update_fields = add_or_update_fields
        if remove_fields is not None:
            self.remove_fields = remove_fields

    @property
    def template_id(self):
        """
        A unique identifier for a property template.

        :rtype: str
        """
        if self._template_id_present:
            return self._template_id_value
        else:
            raise AttributeError("missing required field 'template_id'")

    @template_id.setter
    def template_id(self, val):
        val = self._template_id_validator.validate(val)
        self._template_id_value = val
        self._template_id_present = True

    @template_id.deleter
    def template_id(self):
        self._template_id_value = None
        self._template_id_present = False

    @property
    def add_or_update_fields(self):
        """
        Property fields to update. If the property field already exists, it is
        updated. If the property field doesn't exist, the property group is
        added.

        :rtype: list of [PropertyField]
        """
        if self._add_or_update_fields_present:
            return self._add_or_update_fields_value
        else:
            return None

    @add_or_update_fields.setter
    def add_or_update_fields(self, val):
        if val is None:
            del self.add_or_update_fields
            return
        val = self._add_or_update_fields_validator.validate(val)
        self._add_or_update_fields_value = val
        self._add_or_update_fields_present = True

    @add_or_update_fields.deleter
    def add_or_update_fields(self):
        self._add_or_update_fields_value = None
        self._add_or_update_fields_present = False

    @property
    def remove_fields(self):
        """
        Property fields to remove (by name), provided they exist.

        :rtype: list of [str]
        """
        if self._remove_fields_present:
            return self._remove_fields_value
        else:
            return None

    @remove_fields.setter
    def remove_fields(self, val):
        if val is None:
            del self.remove_fields
            return
        val = self._remove_fields_validator.validate(val)
        self._remove_fields_value = val
        self._remove_fields_present = True

    @remove_fields.deleter
    def remove_fields(self):
        self._remove_fields_value = None
        self._remove_fields_present = False

2111 2112
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertyGroupUpdate, self)._process_custom_annotations(annotation_type, field_path, processor)
2113

2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130
    def __repr__(self):
        return 'PropertyGroupUpdate(template_id={!r}, add_or_update_fields={!r}, remove_fields={!r})'.format(
            self._template_id_value,
            self._add_or_update_fields_value,
            self._remove_fields_value,
        )

PropertyGroupUpdate_validator = bv.Struct(PropertyGroupUpdate)

class PropertyType(bb.Union):
    """
    Data type of the given property field added.

    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.

2131 2132
    :ivar file_properties.PropertyType.string: The associated property field
        will be of type string. Unicode is supported.
2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    string = None
    # Attribute is overwritten below the class definition
    other = None

    def is_string(self):
        """
        Check if the union tag is ``string``.

        :rtype: bool
        """
        return self._tag == 'string'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

2157 2158
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(PropertyType, self)._process_custom_annotations(annotation_type, field_path, processor)
2159

2160 2161 2162 2163 2164
    def __repr__(self):
        return 'PropertyType(%r, %r)' % (self._tag, self._value)

PropertyType_validator = bv.Union(PropertyType)

2165
class RemovePropertiesArg(bb.Struct):
2166
    """
2167 2168 2169 2170
    :ivar file_properties.RemovePropertiesArg.path: A unique identifier for the
        file or folder.
    :ivar file_properties.RemovePropertiesArg.property_template_ids: A list of
        identifiers for a template created by
2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.
    """

    __slots__ = [
        '_path_value',
        '_path_present',
        '_property_template_ids_value',
        '_property_template_ids_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 path=None,
                 property_template_ids=None):
        self._path_value = None
        self._path_present = False
        self._property_template_ids_value = None
        self._property_template_ids_present = False
        if path is not None:
            self.path = path
        if property_template_ids is not None:
            self.property_template_ids = property_template_ids

    @property
    def path(self):
        """
        A unique identifier for the file or folder.

        :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 property_template_ids(self):
        """
        A list of identifiers for a template created by
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.

        :rtype: list of [str]
        """
        if self._property_template_ids_present:
            return self._property_template_ids_value
        else:
            raise AttributeError("missing required field 'property_template_ids'")

    @property_template_ids.setter
    def property_template_ids(self, val):
        val = self._property_template_ids_validator.validate(val)
        self._property_template_ids_value = val
        self._property_template_ids_present = True

    @property_template_ids.deleter
    def property_template_ids(self):
        self._property_template_ids_value = None
        self._property_template_ids_present = False

2246 2247
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(RemovePropertiesArg, self)._process_custom_annotations(annotation_type, field_path, processor)
2248

2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292
    def __repr__(self):
        return 'RemovePropertiesArg(path={!r}, property_template_ids={!r})'.format(
            self._path_value,
            self._property_template_ids_value,
        )

RemovePropertiesArg_validator = bv.Struct(RemovePropertiesArg)

class RemovePropertiesError(PropertiesError):
    """
    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 property_group_lookup(cls, val):
        """
        Create an instance of this class set to the ``property_group_lookup``
        tag with value ``val``.

        :param LookUpPropertiesError val:
        :rtype: RemovePropertiesError
        """
        return cls('property_group_lookup', val)

    def is_property_group_lookup(self):
        """
        Check if the union tag is ``property_group_lookup``.

        :rtype: bool
        """
        return self._tag == 'property_group_lookup'

    def get_property_group_lookup(self):
        """
        Only call this if :meth:`is_property_group_lookup` is true.

        :rtype: LookUpPropertiesError
        """
        if not self.is_property_group_lookup():
            raise AttributeError("tag 'property_group_lookup' not set")
        return self._value

2293 2294
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(RemovePropertiesError, self)._process_custom_annotations(annotation_type, field_path, processor)
2295

2296 2297 2298 2299 2300
    def __repr__(self):
        return 'RemovePropertiesError(%r, %r)' % (self._tag, self._value)

RemovePropertiesError_validator = bv.Union(RemovePropertiesError)

2301
class RemoveTemplateArg(bb.Struct):
2302
    """
2303 2304
    :ivar file_properties.RemoveTemplateArg.template_id: An identifier for a
        template created by
2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.
    """

    __slots__ = [
        '_template_id_value',
        '_template_id_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 template_id=None):
        self._template_id_value = None
        self._template_id_present = False
        if template_id is not None:
            self.template_id = template_id

    @property
    def template_id(self):
        """
        An identifier for a template created by
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_user`
        or
        :meth:`dropbox.dropbox.Dropbox.file_properties_templates_add_for_team`.

        :rtype: str
        """
        if self._template_id_present:
            return self._template_id_value
        else:
            raise AttributeError("missing required field 'template_id'")

    @template_id.setter
    def template_id(self, val):
        val = self._template_id_validator.validate(val)
        self._template_id_value = val
        self._template_id_present = True

    @template_id.deleter
    def template_id(self):
        self._template_id_value = None
        self._template_id_present = False

2350 2351
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(RemoveTemplateArg, self)._process_custom_annotations(annotation_type, field_path, processor)
2352

2353 2354 2355 2356 2357 2358 2359 2360
    def __repr__(self):
        return 'RemoveTemplateArg(template_id={!r})'.format(
            self._template_id_value,
        )

RemoveTemplateArg_validator = bv.Struct(RemoveTemplateArg)

class TemplateFilterBase(bb.Union):
2361 2362 2363 2364 2365
    """
    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.

2366 2367 2368
    :ivar list of [str] file_properties.TemplateFilterBase.filter_some: Only
        templates with an ID in the supplied list will be returned (a subset of
        templates will be returned).
2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381
    """

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    other = None

    @classmethod
    def filter_some(cls, val):
        """
        Create an instance of this class set to the ``filter_some`` tag with
        value ``val``.

        :param list of [str] val:
2382
        :rtype: TemplateFilterBase
2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414
        """
        return cls('filter_some', val)

    def is_filter_some(self):
        """
        Check if the union tag is ``filter_some``.

        :rtype: bool
        """
        return self._tag == 'filter_some'

    def is_other(self):
        """
        Check if the union tag is ``other``.

        :rtype: bool
        """
        return self._tag == 'other'

    def get_filter_some(self):
        """
        Only templates with an ID in the supplied list will be returned (a
        subset of templates will be returned).

        Only call this if :meth:`is_filter_some` is true.

        :rtype: list of [str]
        """
        if not self.is_filter_some():
            raise AttributeError("tag 'filter_some' not set")
        return self._value

2415 2416
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(TemplateFilterBase, self)._process_custom_annotations(annotation_type, field_path, processor)
2417

2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428
    def __repr__(self):
        return 'TemplateFilterBase(%r, %r)' % (self._tag, self._value)

TemplateFilterBase_validator = bv.Union(TemplateFilterBase)

class TemplateFilter(TemplateFilterBase):
    """
    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.

2429 2430
    :ivar file_properties.TemplateFilter.filter_none: No templates will be
        filtered from the result (all templates will be returned).
2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443
    """

    # Attribute is overwritten below the class definition
    filter_none = None

    def is_filter_none(self):
        """
        Check if the union tag is ``filter_none``.

        :rtype: bool
        """
        return self._tag == 'filter_none'

2444 2445
    def _process_custom_annotations(self, annotation_type, field_path, processor):
        super(TemplateFilter, self)._process_custom_annotations(annotation_type, field_path, processor)
2446