def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def get_schema(self):
        """Returns the set YAML schema for the metric class.

        Returns:
          YAML schema of the metrics type.
        """
        return self._schema