docs: def pnl_upsert(self, asset_manager_id, pnls):
          """
          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
          """
          self.logger.info('Upsert PnL for - Asset Manager: %s', asset_manager_id)
          pnls = [pnls] if not isinstance(pnls, list) else pnls
  
          json_pnls = [pnl.to_interface() for pnl in pnls]
          url = '%s/pnls/%s' % (self.endpoint, asset_manager_id)
          response = self.session.put(url, json=json_pnls)
          if response.ok:
              results = []
              for pnl_result in response.json():
                  results.append(json_to_pnl(pnl_result))
              self.logger.info('Upserted %s PnL records', len(results))
              return results
          else:
              self.logger.error(response.text)
              response.raise_for_status()