':param record: Record to update
:type record: :class:`Record`
:param name: Name of the record to update (e.g. foo).
:type name: ``str``
:param type: Type of record (e.g. A, MX etc)
:type type: ``str``
:param data: Data of the record (e.g. 127.0.0.1 for the A record)
:type data: ``str``
:param extra: Extra data needed to create different types of records
:type extra: ``dict``
:return: :class:`Record`'

def update_record(self, record, name, type, data, extra=None):

    zone = record.zone
    action = ('/v1/zones/%s/%s/%s' % (zone.domain, ('%s.%s' % (name, zone.domain)), type))
    raw_data = {'answers': [{'answer': [data]}]}
    if ((extra is not None) and extra.get('answers')):
        raw_data['answers'] = extra.get('answers')
    post_data = json.dumps(raw_data)
    try:
        response = self.connection.request(action=action, data=post_data, method='POST')
    except NsOneException:
        e = sys.exc_info()[1]
        if (e.message == 'record    does    not    exist'):
            raise RecordDoesNotExistError(value=e.message, driver=self, record_id=record.id)
        else:
            raise e
    record = self._to_record(item=response.parse_body(), zone=zone)
    return record
