MCPcopy Create free account
hub / github.com/dropbox/dropbox-sdk-python / TemplateError

Class TemplateError

dropbox/file_properties.py:67–133  ·  view source on GitHub ↗

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 str file_properties.TemplateError.template_not_found: Template does not exist for the gi

Source from the content-addressed store, hash-verified

65AddPropertiesArg_validator = bv.Struct(AddPropertiesArg)
66
67class TemplateError(bb.Union):
68 """
69 This class acts as a tagged union. Only one of the ``is_*`` methods will
70 return true. To get the associated value of a tag (if one exists), use the
71 corresponding ``get_*`` method.
72
73 :ivar str file_properties.TemplateError.template_not_found: Template does
74 not exist for the given identifier.
75 :ivar file_properties.TemplateError.restricted_content: You do not have
76 permission to modify this template.
77 """
78
79 _catch_all = 'other'
80 # Attribute is overwritten below the class definition
81 restricted_content = None
82 # Attribute is overwritten below the class definition
83 other = None
84
85 @classmethod
86 def template_not_found(cls, val):
87 """
88 Create an instance of this class set to the ``template_not_found`` tag
89 with value ``val``.
90
91 :param str val:
92 :rtype: TemplateError
93 """
94 return cls('template_not_found', val)
95
96 def is_template_not_found(self):
97 """
98 Check if the union tag is ``template_not_found``.
99
100 :rtype: bool
101 """
102 return self._tag == 'template_not_found'
103
104 def is_restricted_content(self):
105 """
106 Check if the union tag is ``restricted_content``.
107
108 :rtype: bool
109 """
110 return self._tag == 'restricted_content'
111
112 def is_other(self):
113 """
114 Check if the union tag is ``other``.
115
116 :rtype: bool
117 """
118 return self._tag == 'other'
119
120 def get_template_not_found(self):
121 """
122 Template does not exist for the given identifier.
123
124 Only call this if :meth:`is_template_not_found` is true.

Callers 1

file_properties.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected