- def __init__(self, name, mail, NS,
- secondary_refresh, secondary_retry, secondary_discard,
- NX_TTL = None, A_TTL = None, other_TTL = None,
- domains = []):
+ def __init__(self, name: str, mail: str, NS: List[str],
+ secondary_refresh: int, secondary_retry: int, secondary_expire: int,
+ NX_TTL: int = None, A_TTL: int = None, other_TTL: int = None,
+ domains: Dict[str, Any] = {}) -> None:
+ self._name = check_hostname(name)
+ if not mail.endswith('.'): raise Exception("Mail must be absolute, end with a dot")
+ atpos = mail.find('@')
+ if atpos < 0 or atpos > mail.find('.'): raise Exception("Mail must contain an @ before the first dot")
+ self._mail = check_hostname(mail.replace('@', '.', 1))
+ self._NS = list(map(check_hostname, NS))
+
+ self._refresh = secondary_refresh
+ self._retry = secondary_retry
+ self._expire = secondary_expire
+