code: def batch_save(klass, account, objs):
          
  
          resource = klass.BATCH_RESOURCE_COLLECTION.format(account_id=account.id)
  
          json_body = []
  
          for obj in objs:
              entity_type = klass._ENTITY_MAP[klass.__name__].lower()
              obj_json = {'params': obj.to_params()}
  
              if obj.id is None:
                  obj_json['operation_type'] = 'Create'
              elif obj.to_delete is True:
                  obj_json['operation_type'] = 'Delete'
                  obj_json['params'][entity_type + '_id'] = obj.id
              else:
                  obj_json['operation_type'] = 'Update'
                  obj_json['params'][entity_type + '_id'] = obj.id
  
              json_body.append(obj_json)
  
          resource = klass.BATCH_RESOURCE_COLLECTION.format(account_id=account.id)
          response = Request(account.client,
                             'post', resource,
                             body=json.dumps(json_body),
                             headers={'Content-Type': 'application/json'}).perform()
  
          # persist each entity
          for obj, res_obj in zip(objs, response.body['data']):
              obj = obj.from_response(res_obj)
docs: Makes batch request(s) for a passed in list of objects