

@access.user
@filtermodel(model='item')
@describeRoute(Description('Create a new item.').responseClass('Item').param('folderId', 'The ID of the parent folder.').param('name', 'Name for the item.').param('description', 'Description for the item.', required=False).errorResponse().errorResponse('Write access was denied on the parent folder.', 403))
def createItem(self, params):
    self.requireParams(('name', 'folderId'), params)
    user = self.getCurrentUser()
    name = params['name'].strip()
    description = params.get('description', '').strip()
    folder = self.model('folder').load(id=params['folderId'], user=user, level=AccessType.WRITE, exc=True)
    return self.model('item').createItem(folder=folder, name=name, creator=user, description=description)

dataset/ETHPy150Open girder/girder/girder/api/v1/item.py Item.createItem/original