code: def push_entity(self, entity):
          
          if entity.id:
              print('Updating {} entity'.format(entity.name))
              self.update(entity)
          else:
              print('Registering {} entity'.format(entity.name))
              entity = self.register(entity)
          return entity
docs: Registers or updates an entity and returns the entity_json with an ID