'Update an existing zone.
:param zone: Zone to update.
:type  zone: :class:`Zone`
:param domain: Zone domain name (e.g. example.com)
:type  domain: ``str``
:param type: Zone type (master / slave).
:type  type: ``str``
:param ttl: TTL for new records. (optional)
:type  ttl: ``int``
:param extra: Extra attributes (driver specific) (optional). Values not
specified such as *SECURE*, *IP*, *FOLDER*, *HOSTMASTER*,
*REFRESH*, *RETRY* and *EXPIRE* will be kept as already
is. The same will be for *S(1 to 40)*, *T(1 to 40)* and
*D(1 to 40)* if not in raw mode and for *ZONENS* and
*ZONEDATA* if it is.
:type  extra: ``dict``
:param ex_raw: Mode we use to do the update using zone file or not.
:type  ex_raw: ``bool``
:rtype: :class:`Zone`
For more info, please see
https://www.worldwidedns.net/dns_api_protocol_list_domain.asp
or
https://www.worldwidedns.net/dns_api_protocol_list_domain_raw.asp
or
https://www.worldwidedns.net/dns_api_protocol_list_domain_reseller.asp
or
https://www.worldwidedns.net/dns_api_protocol_list_domain_raw_reseller.asp'

def update_zone(self, zone, domain, type='master', ttl=None, extra=None, ex_raw=False):

    if (extra is not None):
        not_specified = [key for key in zone.extra.keys() if (key not in extra.keys())]
    else:
        not_specified = zone.extra.keys()
    if (ttl is None):
        ttl = zone.ttl
    params = {'DOMAIN': domain, 'TTL': ttl}
    for key in not_specified:
        params[key] = zone.extra[key]
    if (extra is not None):
        params.update(extra)
    if ex_raw:
        action = '/api_dns_modify_raw.asp'
        if (self.reseller_id is not None):
            action = '/api_dns_modify_raw_reseller.asp'
        method = 'POST'
    else:
        action = '/api_dns_modify.asp'
        if (self.reseller_id is not None):
            action = '/api_dns_modify_reseller.asp'
        method = 'GET'
    response = self.connection.request(action, params=params, method=method)
    zone = self.get_zone(zone.id)
    return zone
