我正在尝试使用以下代码将storageSize与文件夹中的每个项目相关联:
foldersApi.getFolderContents(projectId, folderId, {}, oAuth2ThreeLegged, credentials)
.then((response) => {
const data = response.body.data;
const included = response.body.included;
const filesArray = data.filter(thing => thing.type === 'items');
filesArray.forEach(file => {
const version = included.find((i) => i.type === 'versions' && i.relationships.item.data.id === file.id);
file.storageSize = version.attributes.storageSize;
});
})
在Data Management API Fieldguide中,它声明版本对象仅在项目为文件时才具有storageSize
属性。什么类型的项目将不是文件?
文件是否可能缺少此属性?
如果相关,则该文件夹在BIM 360帐户内。
在BIM360项目文件夹中,将存在包括“文件夹”和“项目”的数据类型。