File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 77
88SCHEMAS = [
99 "project_new" ,
10+ "lineitem_update" ,
1011]
1112
1213
@@ -170,6 +171,22 @@ def get_project_detailed_report(self, project_id):
170171 def get_line_item (self , project_id , line_item_id ):
171172 return self ._api_get ('/projects/{}/lineItems/{}' .format (project_id , line_item_id ))
172173
174+ def update_line_item (self , project_id , lineitem_id , lineitem_data ):
175+ '''
176+ Updates the specified line item by setting the values of the parameters passed.
177+ Any parameters not provided will be left unchanged.
178+ '''
179+ # Update an existing line item. Uses the "lineitem_update" schema.
180+ self ._validate_object ("lineitem_update" , lineitem_data )
181+ response_data = self ._api_post ('/projects/{}/lineItems/{}' .format (project_id , lineitem_id ), lineitem_data )
182+ if response_data .get ('status' ).get ('message' ) != 'success' :
183+ raise DemandAPIError (
184+ "Could not update line item. Demand API responded with: {}" .format (
185+ response_data
186+ )
187+ )
188+ return response_data
189+
173190 def get_line_items (self , project_id ):
174191 return self ._api_get ('/projects/{}/lineItems' .format (project_id ))
175192
You can’t perform that action at this time.
0 commit comments