def update_collection(self, payload, last_modified=None):
modified = payload["<STR_LIT:version>"]<EOL>if last_modified is not None:<EOL><INDENT>modified = last_modified<EOL><DEDENT>key = payload["<STR_LIT:key>"]<EOL>headers = {"<STR_LIT>": str(modified)}<EOL>headers.update(self.default_headers())<EOL>headers.update({"<STR_LIT:Content-Type>": "<STR_LIT:application/json>"})<EOL>req = requests.put(<EOL>url=self.endpoint<EOL>+ "<STR_LIT>".format(<EOL>t=self.library_type, u=self.library_id, c=key<EOL>),<EOL>headers=headers,<EOL>data=json.dumps(payload),<EOL>)<EOL>self.request = req<EOL>try:<EOL><INDENT>req.raise_for_status()<EOL><DEDENT>except requests.exceptions.HTTPError:<EOL><INDENT>error_handler(req)<EOL><DEDENT>return True<EOL>
Update a Zotero collection property such as 'name'
Accepts one argument, a dict containing collection data retrieved
using e.g. 'collections()'