dropbox.file_properties
– File Properties
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 PropertyField
. These fields encapsulate the actual key/value data.
Fields are added to a Dropbox file using a PropertyGroup
. Property groups contain a reference to a Dropbox file and a PropertyGroupTemplate
. Property groups are uniquely identified by the combination of their associated Dropbox file and template.
The 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 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.
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).
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.
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.
- class dropbox.file_properties.AddPropertiesArg(path=None, property_groups=None)
Bases:
Struct
- Variables:
file_properties.AddPropertiesArg.path – A unique identifier for the file or folder.
file_properties.AddPropertiesArg.property_groups – The property groups which are to be added to a Dropbox file. No two groups in the input should refer to the same template.
- __init__(path=None, property_groups=None)
- path
- property_groups
- class dropbox.file_properties.AddPropertiesError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.AddPropertiesError.property_group_already_exists – A property group associated with this template and file already exists.
- is_property_group_already_exists()
Check if the union tag is
property_group_already_exists
.- Return type:
bool
- property_group_already_exists = AddPropertiesError('property_group_already_exists', None)
- class dropbox.file_properties.AddTemplateArg(name=None, description=None, fields=None)
Bases:
PropertyGroupTemplate
- __init__(name=None, description=None, fields=None)
- class dropbox.file_properties.AddTemplateResult(template_id=None)
Bases:
Struct
- Variables:
file_properties.AddTemplateResult.template_id – An identifier for template added by See
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.
- __init__(template_id=None)
- template_id
- class dropbox.file_properties.GetTemplateArg(template_id=None)
Bases:
Struct
- Variables:
file_properties.GetTemplateArg.template_id – An identifier for template added by route See
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.
- __init__(template_id=None)
- template_id
- class dropbox.file_properties.GetTemplateResult(name=None, description=None, fields=None)
Bases:
PropertyGroupTemplate
- __init__(name=None, description=None, fields=None)
- class dropbox.file_properties.InvalidPropertyGroupError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.InvalidPropertyGroupError.property_field_too_large – One or more of the supplied property field values is too large.
file_properties.InvalidPropertyGroupError.does_not_fit_template – One or more of the supplied property fields does not conform to the template specifications.
file_properties.InvalidPropertyGroupError.duplicate_property_groups – There are 2 or more property groups referring to the same templates in the input.
- does_not_fit_template = InvalidPropertyGroupError('does_not_fit_template', None)
- duplicate_property_groups = InvalidPropertyGroupError('duplicate_property_groups', None)
- is_does_not_fit_template()
Check if the union tag is
does_not_fit_template
.- Return type:
bool
- is_duplicate_property_groups()
Check if the union tag is
duplicate_property_groups
.- Return type:
bool
- is_property_field_too_large()
Check if the union tag is
property_field_too_large
.- Return type:
bool
- property_field_too_large = InvalidPropertyGroupError('property_field_too_large', None)
- class dropbox.file_properties.ListTemplateResult(template_ids=None)
Bases:
Struct
- Variables:
file_properties.ListTemplateResult.template_ids – List of identifiers for templates added by See
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.
- __init__(template_ids=None)
- template_ids
- class dropbox.file_properties.LogicalOperator(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.LogicalOperator.or_operator – Append a query with an “or” operator.
- is_or_operator()
Check if the union tag is
or_operator
.- Return type:
bool
- is_other()
Check if the union tag is
other
.- Return type:
bool
- or_operator = LogicalOperator('or_operator', None)
- other = LogicalOperator('other', None)
- class dropbox.file_properties.LookUpPropertiesError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.LookUpPropertiesError.property_group_not_found – No property group was found.
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_property_group_not_found()
Check if the union tag is
property_group_not_found
.- Return type:
bool
- other = LookUpPropertiesError('other', None)
- property_group_not_found = LookUpPropertiesError('property_group_not_found', None)
- class dropbox.file_properties.LookupError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.LookupError.not_found – There is nothing at the given path.
file_properties.LookupError.not_file – We were expecting a file, but the given path refers to something that isn’t a file.
file_properties.LookupError.not_folder – We were expecting a folder, but the given path refers to something that isn’t a folder.
file_properties.LookupError.restricted_content – The file cannot be transferred because the content is restricted. For example, we might restrict a file due to legal requirements.
- get_malformed_path()
Only call this if
is_malformed_path()
is true.- Return type:
str
- is_malformed_path()
Check if the union tag is
malformed_path
.- Return type:
bool
- is_not_file()
Check if the union tag is
not_file
.- Return type:
bool
- is_not_folder()
Check if the union tag is
not_folder
.- Return type:
bool
- is_not_found()
Check if the union tag is
not_found
.- Return type:
bool
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_restricted_content()
Check if the union tag is
restricted_content
.- Return type:
bool
- classmethod malformed_path(val)
Create an instance of this class set to the
malformed_path
tag with valueval
.- Parameters:
val (str) –
- Return type:
- not_file = LookupError('not_file', None)
- not_folder = LookupError('not_folder', None)
- not_found = LookupError('not_found', None)
- other = LookupError('other', None)
- restricted_content = LookupError('restricted_content', None)
- class dropbox.file_properties.ModifyTemplateError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.ModifyTemplateError.conflicting_property_names – A property field key with that name already exists in the template.
file_properties.ModifyTemplateError.too_many_properties – There are too many properties in the changed template. The maximum number of properties per template is 32.
file_properties.ModifyTemplateError.too_many_templates – There are too many templates for the team.
file_properties.ModifyTemplateError.template_attribute_too_large – The template name, description or one or more of the property field keys is too large.
- conflicting_property_names = ModifyTemplateError('conflicting_property_names', None)
- is_conflicting_property_names()
Check if the union tag is
conflicting_property_names
.- Return type:
bool
- is_template_attribute_too_large()
Check if the union tag is
template_attribute_too_large
.- Return type:
bool
- is_too_many_properties()
Check if the union tag is
too_many_properties
.- Return type:
bool
- is_too_many_templates()
Check if the union tag is
too_many_templates
.- Return type:
bool
- template_attribute_too_large = ModifyTemplateError('template_attribute_too_large', None)
- too_many_properties = ModifyTemplateError('too_many_properties', None)
- too_many_templates = ModifyTemplateError('too_many_templates', None)
- class dropbox.file_properties.OverwritePropertyGroupArg(path=None, property_groups=None)
Bases:
Struct
- Variables:
file_properties.OverwritePropertyGroupArg.path – A unique identifier for the file or folder.
file_properties.OverwritePropertyGroupArg.property_groups – The property groups “snapshot” updates to force apply. No two groups in the input should refer to the same template.
- __init__(path=None, property_groups=None)
- path
- property_groups
- class dropbox.file_properties.PropertiesError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.PropertiesError.unsupported_folder – This folder cannot be tagged. Tagging folders is not supported for team-owned templates.
- is_path()
Check if the union tag is
path
.- Return type:
bool
- is_unsupported_folder()
Check if the union tag is
unsupported_folder
.- Return type:
bool
- classmethod path(val)
Create an instance of this class set to the
path
tag with valueval
.- Parameters:
val (LookupError) –
- Return type:
- unsupported_folder = PropertiesError('unsupported_folder', None)
- class dropbox.file_properties.PropertiesSearchArg(queries=None, template_filter=None)
Bases:
Struct
- Variables:
file_properties.PropertiesSearchArg.queries – Queries to search.
file_properties.PropertiesSearchArg.template_filter – Filter results to contain only properties associated with these template IDs.
- __init__(queries=None, template_filter=None)
- queries
- template_filter
- class dropbox.file_properties.PropertiesSearchContinueArg(cursor=None)
Bases:
Struct
- Variables:
file_properties.PropertiesSearchContinueArg.cursor – The cursor returned by your last call to
dropbox.dropbox_client.Dropbox.file_properties_properties_search()
ordropbox.dropbox_client.Dropbox.file_properties_properties_search_continue()
.
- __init__(cursor=None)
- cursor
- class dropbox.file_properties.PropertiesSearchContinueError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.PropertiesSearchContinueError.reset – Indicates that the cursor has been invalidated. Call
dropbox.dropbox_client.Dropbox.file_properties_properties_search()
to obtain a new cursor.
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_reset()
Check if the union tag is
reset
.- Return type:
bool
- other = PropertiesSearchContinueError('other', None)
- reset = PropertiesSearchContinueError('reset', None)
- class dropbox.file_properties.PropertiesSearchError(tag, value=None)
Bases:
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 correspondingget_*
method.- get_property_group_lookup()
Only call this if
is_property_group_lookup()
is true.- Return type:
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_property_group_lookup()
Check if the union tag is
property_group_lookup
.- Return type:
bool
- other = PropertiesSearchError('other', None)
- classmethod property_group_lookup(val)
Create an instance of this class set to the
property_group_lookup
tag with valueval
.- Parameters:
val (LookUpPropertiesError) –
- Return type:
- class dropbox.file_properties.PropertiesSearchMatch(id=None, path=None, is_deleted=None, property_groups=None)
Bases:
Struct
- Variables:
file_properties.PropertiesSearchMatch.id – The ID for the matched file or folder.
file_properties.PropertiesSearchMatch.path – The path for the matched file or folder.
file_properties.PropertiesSearchMatch.is_deleted – Whether the file or folder is deleted.
file_properties.PropertiesSearchMatch.property_groups – List of custom property groups associated with the file.
- __init__(id=None, path=None, is_deleted=None, property_groups=None)
- id
- is_deleted
- path
- property_groups
- class dropbox.file_properties.PropertiesSearchMode(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.PropertiesSearchMode.field_name (str) – Search for a value associated with this field name.
- classmethod field_name(val)
Create an instance of this class set to the
field_name
tag with valueval
.- Parameters:
val (str) –
- Return type:
- get_field_name()
Search for a value associated with this field name.
Only call this if
is_field_name()
is true.- Return type:
str
- is_field_name()
Check if the union tag is
field_name
.- Return type:
bool
- is_other()
Check if the union tag is
other
.- Return type:
bool
- other = PropertiesSearchMode('other', None)
- class dropbox.file_properties.PropertiesSearchQuery(query=None, mode=None, logical_operator=None)
Bases:
Struct
- Variables:
file_properties.PropertiesSearchQuery.query – The property field value for which to search across templates.
file_properties.PropertiesSearchQuery.mode – The mode with which to perform the search.
file_properties.PropertiesSearchQuery.logical_operator – The logical operator with which to append the query.
- __init__(query=None, mode=None, logical_operator=None)
- logical_operator
- mode
- query
- class dropbox.file_properties.PropertiesSearchResult(matches=None, cursor=None)
Bases:
Struct
- Variables:
file_properties.PropertiesSearchResult.matches – A list (possibly empty) of matches for the query.
file_properties.PropertiesSearchResult.cursor – Pass the cursor into
dropbox.dropbox_client.Dropbox.file_properties_properties_search_continue()
to continue to receive search results. Cursor will be null when there are no more results.
- __init__(matches=None, cursor=None)
- cursor
- matches
- class dropbox.file_properties.PropertyField(name=None, value=None)
Bases:
Struct
Raw key/value data to be associated with a Dropbox file. Property fields are added to Dropbox files as a
PropertyGroup
.- Variables:
file_properties.PropertyField.name – Key of the property field associated with a file and template. Keys can be up to 256 bytes.
file_properties.PropertyField.value – Value of the property field associated with a file and template. Values can be up to 1024 bytes.
- __init__(name=None, value=None)
- name
- value
- class dropbox.file_properties.PropertyFieldTemplate(name=None, description=None, type=None)
Bases:
Struct
Defines how a single property field may be structured. Used exclusively by
PropertyGroupTemplate
.- Variables:
file_properties.PropertyFieldTemplate.name – Key of the property field being described. Property field keys can be up to 256 bytes.
file_properties.PropertyFieldTemplate.description – Description of the property field. Property field descriptions can be up to 1024 bytes.
file_properties.PropertyFieldTemplate.type – Data type of the value of this property field. This type will be enforced upon property creation and modifications.
- __init__(name=None, description=None, type=None)
- description
- name
- type
- class dropbox.file_properties.PropertyGroup(template_id=None, fields=None)
Bases:
Struct
A subset of the property fields described by the corresponding
PropertyGroupTemplate
. Properties are always added to a Dropbox file as aPropertyGroup
. The possible key names and value types in this group are defined by the correspondingPropertyGroupTemplate
.- Variables:
file_properties.PropertyGroup.template_id – A unique identifier for the associated template.
file_properties.PropertyGroup.fields – The actual properties associated with the template. There can be up to 32 property types per template.
- __init__(template_id=None, fields=None)
- fields
- template_id
- class dropbox.file_properties.PropertyGroupTemplate(name=None, description=None, fields=None)
Bases:
Struct
Defines how a property group may be structured.
- Variables:
file_properties.PropertyGroupTemplate.name – Display name for the template. Template names can be up to 256 bytes.
file_properties.PropertyGroupTemplate.description – Description for the template. Template descriptions can be up to 1024 bytes.
file_properties.PropertyGroupTemplate.fields – Definitions of the property fields associated with this template. There can be up to 32 properties in a single template.
- __init__(name=None, description=None, fields=None)
- description
- fields
- name
- class dropbox.file_properties.PropertyGroupUpdate(template_id=None, add_or_update_fields=None, remove_fields=None)
Bases:
Struct
- Variables:
file_properties.PropertyGroupUpdate.template_id – A unique identifier for a property template.
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.
file_properties.PropertyGroupUpdate.remove_fields – Property fields to remove (by name), provided they exist.
- __init__(template_id=None, add_or_update_fields=None, remove_fields=None)
- add_or_update_fields
- remove_fields
- template_id
- class dropbox.file_properties.PropertyType(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.PropertyType.string – The associated property field will be of type string. Unicode is supported.
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_string()
Check if the union tag is
string
.- Return type:
bool
- other = PropertyType('other', None)
- string = PropertyType('string', None)
- class dropbox.file_properties.RemovePropertiesArg(path=None, property_template_ids=None)
Bases:
Struct
- Variables:
file_properties.RemovePropertiesArg.path – A unique identifier for the file or folder.
file_properties.RemovePropertiesArg.property_template_ids – A list of identifiers for a template created by
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.
- __init__(path=None, property_template_ids=None)
- path
- property_template_ids
- class dropbox.file_properties.RemovePropertiesError(tag, value=None)
Bases:
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 correspondingget_*
method.- get_property_group_lookup()
Only call this if
is_property_group_lookup()
is true.- Return type:
- is_property_group_lookup()
Check if the union tag is
property_group_lookup
.- Return type:
bool
- classmethod property_group_lookup(val)
Create an instance of this class set to the
property_group_lookup
tag with valueval
.- Parameters:
val (LookUpPropertiesError) –
- Return type:
- class dropbox.file_properties.RemoveTemplateArg(template_id=None)
Bases:
Struct
- Variables:
file_properties.RemoveTemplateArg.template_id – An identifier for a template created by
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.
- __init__(template_id=None)
- template_id
- class dropbox.file_properties.TemplateError(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.TemplateError.template_not_found (str) – Template does not exist for the given identifier.
file_properties.TemplateError.restricted_content – You do not have permission to modify this template.
- get_template_not_found()
Template does not exist for the given identifier.
Only call this if
is_template_not_found()
is true.- Return type:
str
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_restricted_content()
Check if the union tag is
restricted_content
.- Return type:
bool
- is_template_not_found()
Check if the union tag is
template_not_found
.- Return type:
bool
- other = TemplateError('other', None)
- restricted_content = TemplateError('restricted_content', None)
- classmethod template_not_found(val)
Create an instance of this class set to the
template_not_found
tag with valueval
.- Parameters:
val (str) –
- Return type:
- class dropbox.file_properties.TemplateFilter(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.TemplateFilter.filter_none – No templates will be filtered from the result (all templates will be returned).
- filter_none = TemplateFilter('filter_none', None)
- is_filter_none()
Check if the union tag is
filter_none
.- Return type:
bool
- class dropbox.file_properties.TemplateFilterBase(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.TemplateFilterBase.filter_some (list of [str]) – Only templates with an ID in the supplied list will be returned (a subset of templates will be returned).
- classmethod filter_some(val)
Create an instance of this class set to the
filter_some
tag with valueval
.- Parameters:
val (list of [str]) –
- Return type:
- get_filter_some()
Only templates with an ID in the supplied list will be returned (a subset of templates will be returned).
Only call this if
is_filter_some()
is true.- Return type:
list of [str]
- is_filter_some()
Check if the union tag is
filter_some
.- Return type:
bool
- is_other()
Check if the union tag is
other
.- Return type:
bool
- other = TemplateFilterBase('other', None)
- class dropbox.file_properties.TemplateOwnerType(tag, value=None)
Bases:
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 correspondingget_*
method.- Variables:
file_properties.TemplateOwnerType.user – Template will be associated with a user.
file_properties.TemplateOwnerType.team – Template will be associated with a team.
- is_other()
Check if the union tag is
other
.- Return type:
bool
- is_team()
Check if the union tag is
team
.- Return type:
bool
- is_user()
Check if the union tag is
user
.- Return type:
bool
- other = TemplateOwnerType('other', None)
- team = TemplateOwnerType('team', None)
- user = TemplateOwnerType('user', None)
- class dropbox.file_properties.UpdatePropertiesArg(path=None, update_property_groups=None)
Bases:
Struct
- Variables:
file_properties.UpdatePropertiesArg.path – A unique identifier for the file or folder.
file_properties.UpdatePropertiesArg.update_property_groups – The property groups “delta” updates to apply.
- __init__(path=None, update_property_groups=None)
- path
- update_property_groups
- class dropbox.file_properties.UpdatePropertiesError(tag, value=None)
Bases:
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 correspondingget_*
method.- get_property_group_lookup()
Only call this if
is_property_group_lookup()
is true.- Return type:
- is_property_group_lookup()
Check if the union tag is
property_group_lookup
.- Return type:
bool
- classmethod property_group_lookup(val)
Create an instance of this class set to the
property_group_lookup
tag with valueval
.- Parameters:
val (LookUpPropertiesError) –
- Return type:
- class dropbox.file_properties.UpdateTemplateArg(template_id=None, name=None, description=None, add_fields=None)
Bases:
Struct
- Variables:
file_properties.UpdateTemplateArg.template_id – An identifier for template added by See
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.file_properties.UpdateTemplateArg.name – A display name for the template. template names can be up to 256 bytes.
file_properties.UpdateTemplateArg.description – Description for the new template. Template descriptions can be up to 1024 bytes.
file_properties.UpdateTemplateArg.add_fields – Property field templates to be added to the group template. There can be up to 32 properties in a single template.
- __init__(template_id=None, name=None, description=None, add_fields=None)
- add_fields
- description
- name
- template_id
- class dropbox.file_properties.UpdateTemplateResult(template_id=None)
Bases:
Struct
- Variables:
file_properties.UpdateTemplateResult.template_id – An identifier for template added by route See
dropbox.dropbox_client.Dropbox.file_properties_templates_add_for_user()
ordropbox.dropbox_client.Dropbox.file_properties_templates_add_for_team()
.
- __init__(template_id=None)
- template_id