5858
5959
6060def create_storage_item (
61- server_context : ServerContext , type : str , props : dict , container_path : str = None , audit_user_comment : str = None
61+ server_context : ServerContext , type : str , props : dict , container_path : str = None
6262):
6363 """
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:
69- :param audit_user_comment: optional comment that will be attached to the audit log record for this storage change.
7070 :return:
7171 """
7272 url = server_context .build_url (STORAGE_CONTROLLER , "create.api" , container_path )
7373 payload = {"type" : type , "props" : props }
74- if audit_user_comment is not None :
75- payload ["auditUserComment" ] = audit_user_comment
7674
7775 return server_context .make_request (url , json = payload )
7876
7977
8078def update_storage_item (
81- server_context : ServerContext , type : str , props : dict , container_path : str = None , audit_user_comment : str = None
79+ server_context : ServerContext , type : str , props : dict , container_path : str = None
8280):
8381 """
8482 Update an existing LabKey Freezer Manager storage item to change its properties or location within the storage hierarchy.
8583 For update_storage_item, the "rowId" primary key value is required to be set within the props.
8684 :param server_context: A LabKey server context. See utils.create_server_context.
8785 :param type:
88- :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.
8988 :param container_path:
90- :param audit_user_comment: optional comment that will be attached to the audit log record for this storage change.
9189 :return:
9290 """
9391 url = server_context .build_url (STORAGE_CONTROLLER , "update.api" , container_path )
9492 payload = {"type" : type , "props" : props }
95- if audit_user_comment is not None :
96- payload ["auditUserComment" ] = audit_user_comment
9793
9894 return server_context .make_request (url , json = payload )
9995
@@ -109,13 +105,14 @@ def delete_storage_item(
109105 :param type:
110106 :param row_id:
111107 :param container_path:
112- :param audit_user_comment: optional comment that will be attached to the audit log record for this storage change .
108+ :param audit_user_comment: optional reason text recorded as the "Reason" on the resulting audit event .
113109 :return:
114110 """
115111 url = server_context .build_url (STORAGE_CONTROLLER , "delete.api" , container_path )
116- payload = {"type" : type , "props" : { " rowId" : row_id } }
112+ props = {"rowId" : row_id }
117113 if audit_user_comment is not None :
118- payload ["auditUserComment" ] = audit_user_comment
114+ props ["auditUserComment" ] = audit_user_comment
115+ payload = {"type" : type , "props" : props }
119116
120117 return server_context .make_request (url , json = payload )
121118
@@ -129,12 +126,12 @@ def __init__(self, server_context: ServerContext):
129126 self .server_context = server_context
130127
131128 @functools .wraps (create_storage_item )
132- def create_storage_item (self , type : str , props : dict , container_path : str = None , audit_user_comment : str = None ):
133- return create_storage_item (self .server_context , type , props , container_path , audit_user_comment )
129+ def create_storage_item (self , type : str , props : dict , container_path : str = None ):
130+ return create_storage_item (self .server_context , type , props , container_path )
134131
135132 @functools .wraps (update_storage_item )
136- def update_storage_item (self , type : str , props : dict , container_path : str = None , audit_user_comment : str = None ):
137- return update_storage_item (self .server_context , type , props , container_path , audit_user_comment )
133+ def update_storage_item (self , type : str , props : dict , container_path : str = None ):
134+ return update_storage_item (self .server_context , type , props , container_path )
138135
139136 @functools .wraps (delete_storage_item )
140137 def delete_storage_item (self , type : str , row_id : int , container_path : str = None , audit_user_comment : str = None ):
0 commit comments