from parallels.core.hosting_repository.virtual_hosting_settings import VirtualHostingSettingsModel
from parallels.plesk.hosting_repository.virtual_hosting_settings import PleskVirtualHostingSettingsModel
from parallels.plesk_multi_server.hosting_repository.base import PleskMultiServerBaseModel


class PleskMultiServerVirtualHostingSettingsModel(VirtualHostingSettingsModel, PleskMultiServerBaseModel):
    def set_web_server_additional_directives(self, subscription_name, domain_name, directives):
        """Set additional Apache/nginx directives of domain

        :type subscription_name: str | unicode
        :type domain_name: str | unicode
        :type directives: parallels.core.hosting_repository.virtual_hosting_settings.WebServerDirectivesEntity
        :rtype: None
        """
        server = self.get_subscription_service_server(subscription_name)
        return PleskVirtualHostingSettingsModel(server).set_web_server_additional_directives(
            subscription_name, domain_name, directives
        )
