File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1549,6 +1549,29 @@ def update_item_owning_collection(
15491549 logging .error (f"Error updating owning collection for item { item .uuid } : { e } " )
15501550 return False
15511551
1552+ def get_item_mapped_collections (self , item ):
1553+ """
1554+ Get the mapped collections of a given item
1555+ @param item: Item object
1556+ @return: Mapped Collection object
1557+ """
1558+ if not isinstance (item , Item ):
1559+ logging .error ("Need a valid item" )
1560+ return None
1561+
1562+ url = f"{ self .API_ENDPOINT } /core/items/{ item .uuid } /mappedCollections"
1563+ try :
1564+ response = self .api_get (url )
1565+ if response .status_code == 200 :
1566+ return parse_json (response )
1567+ else :
1568+ return None
1569+ except Exception as e :
1570+ logging .error (
1571+ f"Error retrieving mapped collections for item { item .uuid } : { e } "
1572+ )
1573+ return None
1574+
15521575 def create_user (self , user , token = None , embeds = None ):
15531576 """
15541577 Create a user
You can’t perform that action at this time.
0 commit comments