FilePropertiesRoutes

public class FilePropertiesRoutes : DropboxTransportClientOwning

Routes for the file_properties namespace For Objective-C compatible routes see DBFilePropertiesRoutes

  • Add property groups to a Dropbox file. See templatesAddForUser or templatesAddForTeam to create new templates.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public func propertiesAdd(
        path: String,
        propertyGroups: [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 a FileProperties.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.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public func propertiesOverwrite(
        path: String,
        propertyGroups: [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 a FileProperties.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.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public func propertiesRemove(
        path: String,
        propertyTemplateIds: [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 a FileProperties.RemovePropertiesError object on failure.

  • Search across property templates for particular property field values.

    • scope: files.metadata.read

    Declaration

    Swift

    @discardableResult
    public func propertiesSearch(
        queries: [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 a FileProperties.PropertiesSearchError object on failure.

  • Once a cursor has been retrieved from propertiesSearch, use this to paginate through all search results.

    • scope: files.metadata.read

    Declaration

    Swift

    @discardableResult
    public 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 a FileProperties.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.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public func propertiesUpdate(
        path: String,
        updatePropertyGroups: [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 a FileProperties.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.

    • scope: files.team_metadata.write

    Declaration

    Swift

    @discardableResult
    public func templatesAddForTeam(
        name: String,
        description_: String,
        fields: [FileProperties.PropertyFieldTemplate]
    )
        -> RpcRequest<FileProperties.AddTemplateResultSerializer, FileProperties.ModifyTemplateErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileProperties.AddTemplateResult object on success or a FileProperties.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.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public func templatesAddForUser(
        name: String,
        description_: String,
        fields: [FileProperties.PropertyFieldTemplate]
    )
        -> RpcRequest<FileProperties.AddTemplateResultSerializer, FileProperties.ModifyTemplateErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileProperties.AddTemplateResult object on success or a FileProperties.ModifyTemplateError object on failure.

  • Get the schema for a specified template.

    • scope: files.team_metadata.write

    Declaration

    Swift

    @discardableResult
    public 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 a FileProperties.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.

    • scope: files.metadata.read

    Declaration

    Swift

    @discardableResult
    public 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 a FileProperties.TemplateError object on failure.

  • Get the template identifiers for a team. To get the schema of each template use templatesGetForTeam.

    • scope: files.team_metadata.write

    Declaration

    Swift

    @discardableResult
    public func templatesListForTeam() -> RpcRequest<FileProperties.ListTemplateResultSerializer, FileProperties.TemplateErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileProperties.ListTemplateResult object on success or a FileProperties.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.

    • scope: files.metadata.read

    Declaration

    Swift

    @discardableResult
    public func templatesListForUser() -> RpcRequest<FileProperties.ListTemplateResultSerializer, FileProperties.TemplateErrorSerializer>

    Return Value

    Through the response callback, the caller will receive a FileProperties.ListTemplateResult object on success or a FileProperties.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.

    • scope: files.team_metadata.write

    Declaration

    Swift

    @discardableResult
    public 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 a FileProperties.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.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public 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 a FileProperties.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.

    • scope: files.team_metadata.write

    Declaration

    Swift

    @discardableResult
    public func templatesUpdateForTeam(
        templateId: String,
        name: String? = nil,
        description_: String? = nil,
        addFields: [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 a FileProperties.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.

    • scope: files.metadata.write

    Declaration

    Swift

    @discardableResult
    public func templatesUpdateForUser(
        templateId: String,
        name: String? = nil,
        description_: String? = nil,
        addFields: [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 a FileProperties.ModifyTemplateError object on failure.