C# Class Box.V2.Managers.BoxMetadataManager

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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat Box.V2.Auth

CreateFileMetadataAsync() public méthode

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
Résultat object>>.Task

CreateFolderMetadataAsync() public méthode

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
Résultat object>>.Task

CreateMetadataTemplate() public méthode

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

DeleteFileMetadataAsync() public méthode

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
Résultat Task

DeleteFolderMetadataAsync() public méthode

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
Résultat Task

GetAllFileMetadataTemplatesAsync() public méthode

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

GetAllFolderMetadataTemplatesAsync() public méthode

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

GetEnterpriseMetadataAsync() public méthode

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
Résultat Task>

GetFileMetadataAsync() public méthode

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
Résultat object>>.Task

GetFolderMetadataAsync() public méthode

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
Résultat object>>.Task

GetMetadataTemplate() public méthode

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
Résultat Task

UpdateFileMetadataAsync() public méthode

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
Résultat object>>.Task

UpdateFolderMetadataAsync() public méthode

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
Résultat object>>.Task

UpdateMetadataTemplate() public méthode

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
Résultat Task