@@ -64,7 +64,8 @@ def create_storage_item(
6464 Create a new LabKey Freezer Manager storage item that can be used in the creation of a storage hierarchy.
6565 :param server_context: A LabKey server context. See utils.create_server_context.
6666 :param type:
67- :param props:
67+ :param props: a dict of property values for the storage item. Any storage item type also accepts an optional
68+ "auditUserComment" (string) entry, which is recorded as the "Reason" on the resulting audit event.
6869 :param container_path:
6970 :return:
7071 """
@@ -82,7 +83,8 @@ def update_storage_item(
8283 For update_storage_item, the "rowId" primary key value is required to be set within the props.
8384 :param server_context: A LabKey server context. See utils.create_server_context.
8485 :param type:
85- :param props:
86+ :param props: a dict of property values for the storage item. Any storage item type also accepts an optional
87+ "auditUserComment" (string) entry, which is recorded as the "Reason" on the resulting audit event.
8688 :param container_path:
8789 :return:
8890 """
@@ -93,7 +95,7 @@ def update_storage_item(
9395
9496
9597def delete_storage_item (
96- server_context : ServerContext , type : str , row_id : int , container_path : str = None
98+ server_context : ServerContext , type : str , row_id : int , container_path : str = None , audit_user_comment : str = None
9799):
98100 """
99101 Delete an existing LabKey Freezer Manager storage item. Note that deletion of freezers, primary storage, or locations
@@ -103,10 +105,14 @@ def delete_storage_item(
103105 :param type:
104106 :param row_id:
105107 :param container_path:
108+ :param audit_user_comment: optional reason text recorded as the "Reason" on the resulting audit event.
106109 :return:
107110 """
108111 url = server_context .build_url (STORAGE_CONTROLLER , "delete.api" , container_path )
109- payload = {"type" : type , "props" : {"rowId" : row_id }}
112+ props = {"rowId" : row_id }
113+ if audit_user_comment is not None :
114+ props ["auditUserComment" ] = audit_user_comment
115+ payload = {"type" : type , "props" : props }
110116
111117 return server_context .make_request (url , json = payload )
112118
@@ -128,5 +134,5 @@ def update_storage_item(self, type: str, props: dict, container_path: str = None
128134 return update_storage_item (self .server_context , type , props , container_path )
129135
130136 @functools .wraps (delete_storage_item )
131- def delete_storage_item (self , type : str , row_id : int , container_path : str = None ):
132- return delete_storage_item (self .server_context , type , row_id , container_path )
137+ def delete_storage_item (self , type : str , row_id : int , container_path : str = None , audit_user_comment : str = None ):
138+ return delete_storage_item (self .server_context , type , row_id , container_path , audit_user_comment )
0 commit comments