code: def publish(self, data, **kwargs):
          
          assert data.get('op') in {'index', 'create', 'delete', 'update'}
          return super(Producer, self).publish(data, **kwargs)
docs: Validate operation type.