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 7
7
8
8
SCHEMAS = [
9
9
"project_new" ,
10
+ "lineitem_update" ,
10
11
]
11
12
12
13
@@ -170,6 +171,22 @@ def get_project_detailed_report(self, project_id):
170
171
def get_line_item (self , project_id , line_item_id ):
171
172
return self ._api_get ('/projects/{}/lineItems/{}' .format (project_id , line_item_id ))
172
173
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
+
173
190
def get_line_items (self , project_id ):
174
191
return self ._api_get ('/projects/{}/lineItems' .format (project_id ))
175
192
You can’t perform that action at this time.
0 commit comments