MetadataModule
public class MetadataModule
Defines methods for metadata management
-
Retrieve all metadata associated with a given file
Declaration
Swift
func list( forFileId fileId: String, completion: @escaping Callback<[MetadataObject]> )Parameters
fileIdThe scope of metadata template - possible values are
global
orenterprise_{id}
completionReturns an array of metadata objects for particular file or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Get the metadata instance for a file.
Declaration
Swift
func get( forFileWithId fileId: String, scope: String, templateKey: String, completion: @escaping Callback<MetadataObject> )Parameters
fileIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns an array of metadata objects for particular file or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Create a metadata instance for a file.
Declaration
Swift
func create( forFileWithId fileId: String, scope: String, templateKey: String, keys: [String: Any], completion: @escaping Callback<MetadataObject> )Parameters
fileIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns an array of metadata objects for particular file or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Update a metadata instance for a file.
Declaration
Swift
func update( forFileWithId fileId: String, scope: String, templateKey: String, operations: [FileMetadataOperation], completion: @escaping Callback<MetadataObject> )Parameters
fileIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns an array of metadata objects for particular file or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Delete a metadata instance for a file.
Declaration
Swift
func delete( forFileWithId fileId: String, scope: String, templateKey: String, completion: @escaping Callback<Void> )Parameters
fileIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
completionReturns success or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Retrieve all metadata associated with a given folder
Declaration
Swift
func list( forFolderId folderId: String, completion: @escaping Callback<[MetadataObject]> )Parameters
folderIdThe scope of metadata template - possible values are
global
orenterprise_{id}
completionReturns an array of metadata objects for particular folder or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Get the metadata instance for a folder.
Declaration
Swift
func get( forFolderWithId folderId: String, scope: String, templateKey: String, completion: @escaping Callback<MetadataObject> )Parameters
folderIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns an array of metadata objects for particular folder or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Create a metadata instance for a folder.
Declaration
Swift
func create( forFolderWithId folderId: String, scope: String, templateKey: String, keys: [String: Any], completion: @escaping Callback<MetadataObject> )Parameters
folderIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns an array of metadata objects for particular folder or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Update a metadata instance for a folder.
Declaration
Swift
func update( forFolderWithId folderId: String, scope: String, templateKey: String, operations: [FolderMetadataOperation], completion: @escaping Callback<MetadataObject> )Parameters
folderIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns an array of metadata objects for particular folder or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Delete a metadata instance for a folder.
Declaration
Swift
func delete( forFolderWithId folderId: String, scope: String, templateKey: String, completion: @escaping Callback<Void> )Parameters
folderIdThe scope of metadata template - possible values are
global
orenterprise_{id}
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
completionReturns success or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Get metadata template by name (templateKey).
Declaration
Swift
func getTemplateByKey( scope: String, templateKey: String, completion: @escaping Callback<MetadataTemplate> )Parameters
scopeThe scope of metadata template - possible values are
global
orenterprise_{id}
templateKeyA unique identifier for the template.
completionReturns a metadata template info or an error if the scope or templateKey are invalid or the user doesn’t have access to the template.
-
Get metadata template by ID.
Declaration
Swift
func getTemplateById( id: String, completion: @escaping Callback<MetadataTemplate> )Parameters
idThe identifier of template
completionReturns a metadata template info or an error if ID is invalid or the user doesn’t have access to the template.
-
Create metadata template.
Declaration
Swift
func createTemplate( scope: String, templateKey: String, displayName: String, hidden: Bool, fields: [MetadataField], completion: @escaping Callback<MetadataTemplate> )Parameters
scopeThe scope of the object. Only the enterprise scope is supported.
templateKeyA unique identifier for the template.
displayNameThe display name of the template.
hiddenWhether this template is hidden in the UI. Defaults to false.
fieldsDefinition of fields for this metadata template.
completionReturns success or an error if template is invalid or the user doesn’t have access to the file.
-
Update metadata template.
Declaration
Swift
func updateTemplate( scope: String, templateKey: String, operation: MetadataTemplateOperation, completion: @escaping Callback<MetadataTemplate> )Parameters
scopeThe scope of the object. Only the enterprise scope is supported.
templateKeyA unique identifier for the template.
operationDescription of operation on template. See template update operations.
completionReturns success or an error if template is invalid or the user doesn’t have access to the file.
-
Delete metadata template.
Declaration
Swift
func deleteTemplate( scope: String, templateKey: String, completion: @escaping Callback<Void> )Parameters
scopeThe scope of the object.
templateKeyMetadata template object
completionReturns success or an error if template is invalid or the user doesn’t have access to the file.
-
Retrieve all metadata templates within the specified enterprise
Declaration
Swift
func listEnterpriseTemplates( scope: String, marker: String? = nil, limit: Int? = nil ) -> MarkerPaginationIterator<MetadataTemplate>Parameters
scopeThe scope of the object. Only the enterprise scope is supported.
markerThe position marker at which to begin the response. See marker-based paging for details.
limitThe maximum number of items to return. The default is 100 and the maximum is 1,000.
MetadataModule Class Reference