C# Класс Box.V2.Managers.BoxMetadataManager

Metadata allows users and applications to define and store custom data associated with their files/folders
Наследование: BoxResourceManager
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

BoxMetadataManager() публичный Метод

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
Результат Box.V2.Auth

CreateFileMetadataAsync() публичный Метод

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
Результат object>>.Task

CreateFolderMetadataAsync() публичный Метод

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
Результат object>>.Task

CreateMetadataTemplate() публичный Метод

Used to create a new metadata template with the specified schema.
public CreateMetadataTemplate ( BoxMetadataTemplate template ) : Task
template Box.V2.Models.BoxMetadataTemplate BoxMetadataTemplate object
Результат Task

DeleteFileMetadataAsync() публичный Метод

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
Результат Task

DeleteFolderMetadataAsync() публичный Метод

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
Результат Task

GetAllFileMetadataTemplatesAsync() публичный Метод

Used to retrieve all metadata associated with a given file
public GetAllFileMetadataTemplatesAsync ( string fileId ) : object>>>.Task
fileId string Id of file
Результат object>>>.Task

GetAllFolderMetadataTemplatesAsync() публичный Метод

Used to retrieve all metadata associated with a given folder
public GetAllFolderMetadataTemplatesAsync ( string folderId ) : object>>>.Task
folderId string Id of folder
Результат object>>>.Task

GetEnterpriseMetadataAsync() публичный Метод

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
Результат Task>

GetFileMetadataAsync() публичный Метод

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
Результат object>>.Task

GetFolderMetadataAsync() публичный Метод

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
Результат object>>.Task

GetMetadataTemplate() публичный Метод

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
Результат Task

UpdateFileMetadataAsync() публичный Метод

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
Результат object>>.Task

UpdateFolderMetadataAsync() публичный Метод

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
Результат object>>.Task

UpdateMetadataTemplate() публичный Метод

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
Результат Task