FilePropertiesRoutes
open class FilePropertiesRoutes
Routes for the file_properties namespace
-
Add property groups to a Dropbox file. See templatesAddForUser or templatesAddForTeam to create new templates.
Declaration
Swift
@discardableResult open func propertiesAdd(path: String, propertyGroups: Array<FileProperties.PropertyGroup>) -> RpcRequest<VoidSerializer, FileProperties.AddPropertiesErrorSerializer>
Parameters
path
A unique identifier for the file or folder.
propertyGroups
The property groups which are to be added to a Dropbox file. No two groups in the input should refer to the same template.
Return Value
Through the response callback, the caller will receive a
Void
object on success or aFileProperties.AddPropertiesError
object on failure. -
Overwrite property groups associated with a file. This endpoint should be used instead of propertiesUpdate when property groups are being updated via a “snapshot” instead of via a “delta”. In other words, this endpoint will delete all omitted fields from a property group, whereas propertiesUpdate will only delete fields that are explicitly marked for deletion.
Declaration
Swift
@discardableResult open func propertiesOverwrite(path: String, propertyGroups: Array<FileProperties.PropertyGroup>) -> RpcRequest<VoidSerializer, FileProperties.InvalidPropertyGroupErrorSerializer>
Parameters
path
A unique identifier for the file or folder.
propertyGroups
The property groups “snapshot” updates to force apply. No two groups in the input should refer to the same template.
Return Value
Through the response callback, the caller will receive a
Void
object on success or aFileProperties.InvalidPropertyGroupError
object on failure. -
Permanently removes the specified property group from the file. To remove specific property field key value pairs, see propertiesUpdate. To update a template, see templatesUpdateForUser or templatesUpdateForTeam. To remove a template, see templatesRemoveForUser or templatesRemoveForTeam.
Declaration
Swift
@discardableResult open func propertiesRemove(path: String, propertyTemplateIds: Array<String>) -> RpcRequest<VoidSerializer, FileProperties.RemovePropertiesErrorSerializer>
Parameters
path
A unique identifier for the file or folder.
propertyTemplateIds
A list of identifiers for a template created by templatesAddForUser or templatesAddForTeam.
Return Value
Through the response callback, the caller will receive a
Void
object on success or aFileProperties.RemovePropertiesError
object on failure. -
Search across property templates for particular property field values.
Declaration
Swift
@discardableResult open func propertiesSearch(queries: Array<FileProperties.PropertiesSearchQuery>, templateFilter: FileProperties.TemplateFilter = .filterNone) -> RpcRequest<FileProperties.PropertiesSearchResultSerializer, FileProperties.PropertiesSearchErrorSerializer>
Parameters
queries
Queries to search.
templateFilter
Filter results to contain only properties associated with these template IDs.
Return Value
Through the response callback, the caller will receive a
FileProperties.PropertiesSearchResult
object on success or aFileProperties.PropertiesSearchError
object on failure. -
Once a cursor has been retrieved from propertiesSearch, use this to paginate through all search results.
Declaration
Swift
@discardableResult open func propertiesSearchContinue(cursor: String) -> RpcRequest<FileProperties.PropertiesSearchResultSerializer, FileProperties.PropertiesSearchContinueErrorSerializer>
Parameters
cursor
The cursor returned by your last call to propertiesSearch or propertiesSearchContinue.
Return Value
Through the response callback, the caller will receive a
FileProperties.PropertiesSearchResult
object on success or aFileProperties.PropertiesSearchContinueError
object on failure. -
Add, update or remove properties associated with the supplied file and templates. This endpoint should be used instead of propertiesOverwrite when property groups are being updated via a “delta” instead of via a “snapshot” . In other words, this endpoint will not delete any omitted fields from a property group, whereas propertiesOverwrite will delete any fields that are omitted from a property group.
Declaration
Swift
@discardableResult open func propertiesUpdate(path: String, updatePropertyGroups: Array<FileProperties.PropertyGroupUpdate>) -> RpcRequest<VoidSerializer, FileProperties.UpdatePropertiesErrorSerializer>
Parameters
path
A unique identifier for the file or folder.
updatePropertyGroups
The property groups “delta” updates to apply.
Return Value
Through the response callback, the caller will receive a
Void
object on success or aFileProperties.UpdatePropertiesError
object on failure. -
Add a template associated with a team. See propertiesAdd to add properties to a file or folder. Note: this endpoint will create team-owned templates.
Declaration
Swift
@discardableResult open func templatesAddForTeam(name: String, description_: String, fields: Array<FileProperties.PropertyFieldTemplate>) -> RpcRequest<FileProperties.AddTemplateResultSerializer, FileProperties.ModifyTemplateErrorSerializer>
Return Value
Through the response callback, the caller will receive a
FileProperties.AddTemplateResult
object on success or aFileProperties.ModifyTemplateError
object on failure. -
Add a template associated with a user. See propertiesAdd to add properties to a file. This endpoint can’t be called on a team member or admin’s behalf.
Declaration
Swift
@discardableResult open func templatesAddForUser(name: String, description_: String, fields: Array<FileProperties.PropertyFieldTemplate>) -> RpcRequest<FileProperties.AddTemplateResultSerializer, FileProperties.ModifyTemplateErrorSerializer>
Return Value
Through the response callback, the caller will receive a
FileProperties.AddTemplateResult
object on success or aFileProperties.ModifyTemplateError
object on failure. -
Get the schema for a specified template.
Declaration
Swift
@discardableResult open func templatesGetForTeam(templateId: String) -> RpcRequest<FileProperties.GetTemplateResultSerializer, FileProperties.TemplateErrorSerializer>
Parameters
templateId
An identifier for template added by route See templatesAddForUser or templatesAddForTeam.
Return Value
Through the response callback, the caller will receive a
FileProperties.GetTemplateResult
object on success or aFileProperties.TemplateError
object on failure. -
Get the schema for a specified template. This endpoint can’t be called on a team member or admin’s behalf.
Declaration
Swift
@discardableResult open func templatesGetForUser(templateId: String) -> RpcRequest<FileProperties.GetTemplateResultSerializer, FileProperties.TemplateErrorSerializer>
Parameters
templateId
An identifier for template added by route See templatesAddForUser or templatesAddForTeam.
Return Value
Through the response callback, the caller will receive a
FileProperties.GetTemplateResult
object on success or aFileProperties.TemplateError
object on failure. -
Get the template identifiers for a team. To get the schema of each template use templatesGetForTeam.
Declaration
Swift
@discardableResult open func templatesListForTeam() -> RpcRequest<FileProperties.ListTemplateResultSerializer, FileProperties.TemplateErrorSerializer>
Return Value
Through the response callback, the caller will receive a
FileProperties.ListTemplateResult
object on success or aFileProperties.TemplateError
object on failure. -
Get the template identifiers for a team. To get the schema of each template use templatesGetForUser. This endpoint can’t be called on a team member or admin’s behalf.
Declaration
Swift
@discardableResult open func templatesListForUser() -> RpcRequest<FileProperties.ListTemplateResultSerializer, FileProperties.TemplateErrorSerializer>
Return Value
Through the response callback, the caller will receive a
FileProperties.ListTemplateResult
object on success or aFileProperties.TemplateError
object on failure. -
Permanently removes the specified template created from templatesAddForUser. All properties associated with the template will also be removed. This action cannot be undone.
Declaration
Swift
@discardableResult open func templatesRemoveForTeam(templateId: String) -> RpcRequest<VoidSerializer, FileProperties.TemplateErrorSerializer>
Parameters
templateId
An identifier for a template created by templatesAddForUser or templatesAddForTeam.
Return Value
Through the response callback, the caller will receive a
Void
object on success or aFileProperties.TemplateError
object on failure. -
Permanently removes the specified template created from templatesAddForUser. All properties associated with the template will also be removed. This action cannot be undone.
Declaration
Swift
@discardableResult open func templatesRemoveForUser(templateId: String) -> RpcRequest<VoidSerializer, FileProperties.TemplateErrorSerializer>
Parameters
templateId
An identifier for a template created by templatesAddForUser or templatesAddForTeam.
Return Value
Through the response callback, the caller will receive a
Void
object on success or aFileProperties.TemplateError
object on failure. -
Update a template associated with a team. This route can update the template name, the template description and add optional properties to templates.
Declaration
Swift
@discardableResult open func templatesUpdateForTeam(templateId: String, name: String? = nil, description_: String? = nil, addFields: Array<FileProperties.PropertyFieldTemplate>? = nil) -> RpcRequest<FileProperties.UpdateTemplateResultSerializer, FileProperties.ModifyTemplateErrorSerializer>
Parameters
templateId
An identifier for template added by See templatesAddForUser or templatesAddForTeam.
name
A display name for the template. template names can be up to 256 bytes.
description_
Description for the new template. Template descriptions can be up to 1024 bytes.
addFields
Property field templates to be added to the group template. There can be up to 32 properties in a single template.
Return Value
Through the response callback, the caller will receive a
FileProperties.UpdateTemplateResult
object on success or aFileProperties.ModifyTemplateError
object on failure. -
Update a template associated with a user. This route can update the template name, the template description and add optional properties to templates. This endpoint can’t be called on a team member or admin’s behalf.
Declaration
Swift
@discardableResult open func templatesUpdateForUser(templateId: String, name: String? = nil, description_: String? = nil, addFields: Array<FileProperties.PropertyFieldTemplate>? = nil) -> RpcRequest<FileProperties.UpdateTemplateResultSerializer, FileProperties.ModifyTemplateErrorSerializer>
Parameters
templateId
An identifier for template added by See templatesAddForUser or templatesAddForTeam.
name
A display name for the template. template names can be up to 256 bytes.
description_
Description for the new template. Template descriptions can be up to 1024 bytes.
addFields
Property field templates to be added to the group template. There can be up to 32 properties in a single template.
Return Value
Through the response callback, the caller will receive a
FileProperties.UpdateTemplateResult
object on success or aFileProperties.ModifyTemplateError
object on failure.