from parallels.core.target_data_model import TargetSubscriptionData
from parallels.core.utils.common import default


class PleskMultiServerTargetSubscriptionData(TargetSubscriptionData):
    IP_TYPE_SHARED = 'shared'
    IP_TYPE_EXCLUSIVE = 'exclusive'

    def __init__(self, node_ip=None, ipv4_type=None, ipv6_type=None):
        self._node_ip = node_ip
        self._ipv4_type = default(ipv4_type, self.IP_TYPE_SHARED)
        self._ipv6_type = ipv6_type

    @property
    def node_ip(self):
        """IP of the node to which subscription should be provisioned (could be not equal to resulting subscription IP)

        :rtype: str | unicode | None
        """
        return self._node_ip

    @property
    def ipv4_type(self):
        """Type of desired IPv4 address (shared or dedicated) - see IP_TYPE_* constants

        :rtype: str | unicode | None
        """
        return self._ipv4_type

    @property
    def ipv6_type(self):
        """Type of desired IPv6 address (shared or dedicated) - see IP_TYPE_* constants

        :rtype: str | unicode | None
        """
        return self._ipv6_type
