C# Class Box.V2.Managers.BoxMetadataManager

Metadata allows users and applications to define and store custom data associated with their files/folders
Inheritance: BoxResourceManager
Mostra file Open project: box/box-windows-sdk-v2 Class Usage Examples

Public Methods

Method Description
BoxMetadataManager ( IBoxConfig config, IBoxService service, IBoxConverter converter, IAuthRepository auth, string asUser = null, bool suppressNotifications = null ) : Box.V2.Auth
CreateFileMetadataAsync ( string fileId, object>.Dictionary metadata, string scope, string template ) : object>>.Task

Used to create the metadata template instance for a corresponding Box file. When creating metadata, only values that adhere to the metadata template schema will be accepted.

CreateFolderMetadataAsync ( string folderId, object>.Dictionary metadata, string scope, string template ) : object>>.Task

Used to create the metadata template instance for a corresponding Box folder. When creating metadata, only values that adhere to the metadata template schema will be accepted.

CreateMetadataTemplate ( BoxMetadataTemplate template ) : Task

Used to create a new metadata template with the specified schema.

DeleteFileMetadataAsync ( string fileId, string scope, string template ) : Task

Used to delete the template instance. To delete custom key:value pairs within a template instance, you should refer to the updating metadata section.

DeleteFolderMetadataAsync ( string folderId, string scope, string template ) : Task

Used to delete the template instance. To delete custom key:value pairs within a template instance, you should refer to the updating metadata section.

GetAllFileMetadataTemplatesAsync ( string fileId ) : object>>>.Task

Used to retrieve all metadata associated with a given file

GetAllFolderMetadataTemplatesAsync ( string folderId ) : object>>>.Task

Used to retrieve all metadata associated with a given folder

GetEnterpriseMetadataAsync ( string scope = "enterprise" ) : Task>

Used to retrieve all metadata templates within a user's enterprise. Currently only the enterprise scope is supported.

GetFileMetadataAsync ( string fileId, string scope, string template ) : object>>.Task

Used to retrieve the metadata template instance for a corresponding Box file.

GetFolderMetadataAsync ( string folderId, string scope, string template ) : object>>.Task

Used to retrieve the metadata template instance for a corresponding Box folder.

GetMetadataTemplate ( string scope, string template ) : Task

Used to retrieve the schema for a given metadata template.

UpdateFileMetadataAsync ( string fileId, List updates, string scope, string template ) : object>>.Task

Used to update the template instance. The request body must follow the JSON-Patch specification, which is represented as a JSON array of operation objects (see examples for more details). Updates can be either add, replace, remove , test, move, or copy. The template instance can only be updated if the template instance already exists. When editing metadata, only values that adhere to the metadata template schema will be accepted. The update is applied atomically. If any errors occur during the application of the update operations, the metadata instance remains unchanged.

UpdateFolderMetadataAsync ( string folderId, List updates, string scope, string template ) : object>>.Task

Used to update the template instance. Updates can be either add, replace, remove , or test. The template instance can only be updated if the template instance already exists. When editing metadata, only values that adhere to the metadata template schema will be accepted.

UpdateMetadataTemplate ( List metadataTemplateUpdate, string scope, string template ) : Task

Used to update the schema of an existing template.

Private Methods

Method Description
CreateMetadata ( Uri hostUri, string id, object>.Dictionary metadata, string scope, string template ) : object>>.Task
DeleteMetadata ( Uri hostUri, string id, string scope, string template ) : Task
GetMetadata ( Uri hostUri, string id, string scope, string template ) : object>>.Task
UpdateMetadata ( Uri hostUri, string id, List updates, string scope, string template ) : object>>.Task

Method Details

BoxMetadataManager() public method

public BoxMetadataManager ( IBoxConfig config, IBoxService service, IBoxConverter converter, IAuthRepository auth, string asUser = null, bool suppressNotifications = null ) : Box.V2.Auth
config IBoxConfig
service IBoxService
converter IBoxConverter
auth IAuthRepository
asUser string
suppressNotifications bool
return Box.V2.Auth

CreateFileMetadataAsync() public method

Used to create the metadata template instance for a corresponding Box file. When creating metadata, only values that adhere to the metadata template schema will be accepted.
public CreateFileMetadataAsync ( string fileId, object>.Dictionary metadata, string scope, string template ) : object>>.Task
fileId string Id of file
metadata object>.Dictionary Metadata to create
scope string Scope name. Currently, the only scopes support are enterprise and global
template string Metadata template name
return object>>.Task

CreateFolderMetadataAsync() public method

Used to create the metadata template instance for a corresponding Box folder. When creating metadata, only values that adhere to the metadata template schema will be accepted.
public CreateFolderMetadataAsync ( string folderId, object>.Dictionary metadata, string scope, string template ) : object>>.Task
folderId string Id of folder
metadata object>.Dictionary Metadata to create
scope string Scope name. Currently, only the enterprise scope is supported
template string Metadata template name
return object>>.Task

CreateMetadataTemplate() public method

Used to create a new metadata template with the specified schema.
public CreateMetadataTemplate ( BoxMetadataTemplate template ) : Task
template Box.V2.Models.BoxMetadataTemplate BoxMetadataTemplate object
return Task

DeleteFileMetadataAsync() public method

Used to delete the template instance. To delete custom key:value pairs within a template instance, you should refer to the updating metadata section.
public DeleteFileMetadataAsync ( string fileId, string scope, string template ) : Task
fileId string Id of file
scope string Scope name. Currently, the only scopes support are enterprise and global
template string Metadata template name
return Task

DeleteFolderMetadataAsync() public method

Used to delete the template instance. To delete custom key:value pairs within a template instance, you should refer to the updating metadata section.
public DeleteFolderMetadataAsync ( string folderId, string scope, string template ) : Task
folderId string Id of folder
scope string Scope name. Currently, only the enterprise scope is supported
template string Metadata template name
return Task

GetAllFileMetadataTemplatesAsync() public method

Used to retrieve all metadata associated with a given file
public GetAllFileMetadataTemplatesAsync ( string fileId ) : object>>>.Task
fileId string Id of file
return object>>>.Task

GetAllFolderMetadataTemplatesAsync() public method

Used to retrieve all metadata associated with a given folder
public GetAllFolderMetadataTemplatesAsync ( string folderId ) : object>>>.Task
folderId string Id of folder
return object>>>.Task

GetEnterpriseMetadataAsync() public method

Used to retrieve all metadata templates within a user's enterprise. Currently only the enterprise scope is supported.
public GetEnterpriseMetadataAsync ( string scope = "enterprise" ) : Task>
scope string Scope name. Currently, the only scopes support are enterprise and global
return Task>

GetFileMetadataAsync() public method

Used to retrieve the metadata template instance for a corresponding Box file.
public GetFileMetadataAsync ( string fileId, string scope, string template ) : object>>.Task
fileId string Id of file
scope string Scope name. Currently, the only scopes supported are enterprise and global
template string Metadata template name
return object>>.Task

GetFolderMetadataAsync() public method

Used to retrieve the metadata template instance for a corresponding Box folder.
public GetFolderMetadataAsync ( string folderId, string scope, string template ) : object>>.Task
folderId string Id of folder
scope string Scope name. Currently, only the enterprise scope is supported
template string Metadata template name
return object>>.Task

GetMetadataTemplate() public method

Used to retrieve the schema for a given metadata template.
public GetMetadataTemplate ( string scope, string template ) : Task
scope string Scope name. Currently, the only scopes supported are enterprise and global
template string Metadata template name
return Task

UpdateFileMetadataAsync() public method

Used to update the template instance. The request body must follow the JSON-Patch specification, which is represented as a JSON array of operation objects (see examples for more details). Updates can be either add, replace, remove , test, move, or copy. The template instance can only be updated if the template instance already exists. When editing metadata, only values that adhere to the metadata template schema will be accepted. The update is applied atomically. If any errors occur during the application of the update operations, the metadata instance remains unchanged.
public UpdateFileMetadataAsync ( string fileId, List updates, string scope, string template ) : object>>.Task
fileId string Id of file
updates List Metadata updates to apply
scope string Scope name. Currently, the only scopes support are enterprise and global
template string Metadata template name
return object>>.Task

UpdateFolderMetadataAsync() public method

Used to update the template instance. Updates can be either add, replace, remove , or test. The template instance can only be updated if the template instance already exists. When editing metadata, only values that adhere to the metadata template schema will be accepted.
public UpdateFolderMetadataAsync ( string folderId, List updates, string scope, string template ) : object>>.Task
folderId string Id of folder
updates List Metadata updates to apply
scope string Scope name. Currently, only the enterprise scope is supported
template string Metadata template name
return object>>.Task

UpdateMetadataTemplate() public method

Used to update the schema of an existing template.
public UpdateMetadataTemplate ( List metadataTemplateUpdate, string scope, string template ) : Task
metadataTemplateUpdate List BoxMetadataTemplateUpdate object
scope string Scope name. Currently, the only scopes supported are enterprise and global
template string Metadata template name
return Task