MetadataCascadePolicyModule
public class MetadataCascadePolicyModule
Defines methods for metadata management
-
Retrieve an iterator for available metadata cascade policies within a given folder for the current enterprise.
Declaration
Swift
public func list( folderId: String, ownerEnterpriseId: String? = nil, fields: [String]? = nil, marker: String? = nil, limit: Int? = nil ) -> PagingIterator<MetadataCascadePolicy>
Parameters
folderId
Specifies which folders’ policies to return.
ownerEnterpriseId
The ID of the owner of the metadata cascade policies. If not specified, defaults to current enterprise.
fields
Comma-separated list of fields to include in the response.
marker
The position marker at which to begin the response. See marker-based paging for details.
limit
The maximum number of items to return. The default is 100 and the maximum is 1,000.
-
Get information about a specific metadata cascade policy.
Declaration
Swift
public func get( id: String, fields: [String]? = nil, completion: @escaping Callback<MetadataCascadePolicy> )
Parameters
id
The ID of the cascade policy.
fields
Comma-separated list of fields to include in the response.
completion
The metadata cascade policy object is returned or an error
-
Create a metadata cascade policy that applies to a given folder and a metadata instance attached to the given folder. In order for the policy to work, a metadata instance must be applied to the folder.
Declaration
Swift
public func create( folderId: String, scope: MetadataScope, templateKey: String, fields: [String]? = nil, completion: @escaping Callback<MetadataCascadePolicy> )
Parameters
folderId
The ID of the folder.
scope
The scope of the metadata object (global or enterprise_{enterprise_id})
templateKey
The key of the template. For example, the global scope has the properties template.
fields
Comma-separated list of fields to include in the response.
completion
The metadata cascade policy object is returned or an error
-
Delete a metadata cascade policy that applies to a given folder and a folder-attached instance of given template.
Declaration
Swift
public func delete( id: String, completion: @escaping Callback<Void> )
Parameters
id
The ID of the cascade policy.
completion
An empty response will be returned upon successful deletion or an error
-
If a policy already exists on a folder, this will apply that policy to all existing files and sub-folders within the target folder.
Declaration
Swift
public func forceApply( id: String, conflictResolution: ConflictResolution, completion: @escaping Callback<Void> )
Parameters
id
The ID of the cascade policy.
conflictResolution
The desired behavior for conflict-resolution if a template already exists on a given file or folder. Currently supported values are none, which will preserve the existing value on the file, and overwrite, which will force-apply the cascade policy’s value over any existing value.
completion
An empty response will be returned upon successful deletion or an error