from parallels.core.utils.entity import Entity


class HostingDescriptionConfig(Entity):
    def __init__(self, source_id, path, file_format, validation_mode=None, mail_settings=None):
        """
        :type source_id: str | unicode
        :type path: str | unicode
        :type file_format: str | unicode
        """
        self._source_id = source_id
        self._path = path
        self._file_format = file_format
        self._validation_mode = validation_mode
        self._mail_settings = mail_settings

    @property
    def source_id(self):
        """Source ID - section name in migrator's configuration file

        :rtype: str | unicode
        """
        return self._source_id

    @property
    def path(self):
        """Path to the hosting description file

        :rtype: str | unicode
        """
        return self._path

    @property
    def file_format(self):
        """File format of the hosting description file: JSON or YAML (see FORMAT_* constants)

        :rtype: str | unicode
        """
        return self._file_format

    @property
    def validation_mode(self):
        """Validation mode for that hosting description file

        See parallels.plesk.hosting_description.validate.mode.ValidationMode for details

        :rtype: str | unicode
        """
        return self._validation_mode

    @property
    def mail_settings(self):
        """Configuration options to copy mail settings

        :rtype: parallels.core.migrator_config.CopyMailContentSettings | None
        """
        return self._mail_settings
