def rec_edit(self, zone, record_type, record_id, name, content, ttl=1, service_mode=None, priority=None,
                 service=None, service_name=None, protocol=None, weight=None, port=None, target=None):
        """
        Edit a DNS record for the given zone.
        :param zone: domain name
        :type zone: str
        :param record_type: Type of DNS record. Valid values are [A/CNAME/MX/TXT/SPF/AAAA/NS/SRV/LOC]
        :type record_type: str
        :param record_id: DNS Record ID. Available by using the rec_load_all call.
        :type record_id: int
        :param name: Name of the DNS record
        :type name: str
        :param content: The content of the DNS record, will depend on the the type of record being added
        :type content: str
        :param ttl: TTL of record in seconds. 1 = Automatic, otherwise, value must in between 120 and 4,294,967,295
            seconds.
        :type ttl: int
        :param service_mode: [applies to A/AAAA/CNAME] Status of CloudFlare Proxy, 1 = orange cloud, 0 = grey cloud.
        :type service_mode: int
        :param priority: [applies to MX/SRV] MX record priority.
        :type priority: int
        :param service: Service for SRV record
        :type service: str
        :param service_name: Service Name for SRV record
        :type service_name: str
        :param protocol: Protocol for SRV record. Values are [_tcp/_udp/_tls].
        :type protocol: str
        :param weight: Weight for SRV record.
        :type weight: int
        :param port: Port for SRV record
        :type port: int
        :param target: Target for SRV record
        :type target: str
        :return:
        :rtype: dict
        """
        params = {
            'a': 'rec_edit',
            'z': zone,
            'type': record_type,
            'id': record_id,
            'name': name,
            'content': content,
            'ttl': ttl
        }
        if service_mode is not None:
            params['service_mode'] = service_mode
        if priority is not None:
            params['prio'] = priority
        if service is not None:
            params['service'] = service
        if service_name is not None:
            params['srvname'] = service_name
        if protocol is not None:
            params['protocol'] = protocol
        if weight is not None:
            params['weight'] = weight
        if port is not None:
            params['port'] = port
        if target is not None:
            params['target'] = target
        return self._request(params)