def pnl_upsert(self, asset_manager_id, pnls):
self.logger.info('<STR_LIT>', asset_manager_id)<EOL>pnls = [pnls] if not isinstance(pnls, list) else pnls<EOL>json_pnls = [pnl.to_interface() for pnl in pnls]<EOL>url = '<STR_LIT>' % (self.endpoint, asset_manager_id)<EOL>response = self.session.put(url, json=json_pnls)<EOL>if response.ok:<EOL><INDENT>results = []<EOL>for pnl_result in response.json():<EOL><INDENT>results.append(json_to_pnl(pnl_result))<EOL><DEDENT>self.logger.info('<STR_LIT>', len(results))<EOL>return results<EOL><DEDENT>else:<EOL><INDENT>self.logger.error(response.text)<EOL>response.raise_for_status()<EOL><DEDENT>
Upsert a list of pnls. Note: this performs a full update
of existing records with matching keys, so the passed in
pnl objects should be complete.

Args:
    asset_manager_id (int): the id of the asset manager owning the pnl
    pnls (list): list of pnl objects to upsert