def add(self, type_):
    '\n        Add a Product\n\n        :param datacube.model.DatasetType type_: Product to add\n        :rtype: datacube.model.DatasetType\n        '
    DatasetType.validate(type_.definition)
    existing = self._db.get_dataset_type_by_name(type_.name)
    if existing:
        check_doc_unchanged(existing.definition, jsonify_document(type_.definition), 'Dataset type {}'.format(type_.name))
    else:
        self._db.add_dataset_type(name=type_.name, metadata=type_.metadata_doc, metadata_type_id=type_.metadata_type.id, definition=type_.definition)
    return self.get_by_name(type_.name)
Add a Product

:param datacube.model.DatasetType type_: Product to add
:rtype: datacube.model.DatasetType
def add(self, type_):
    '\n        Add a Product\n\n        :param datacube.model.DatasetType type_: Product to add\n        :rtype: datacube.model.DatasetType\n        '
    DatasetType.validate(type_.definition)
    existing = self._db.get_dataset_type_by_name(type_.name)
    if existing:
        check_doc_unchanged(existing.definition, jsonify_document(type_.definition), 'Dataset type {}'.format(type_.name))
    else:
        self._db.add_dataset_type(name=type_.name, metadata=type_.metadata_doc, metadata_type_id=type_.metadata_type.id, definition=type_.definition)
    return self.get_by_name(type_.name)