'Create a new record.
:param name: Record name fully qualified, with a \'.\' at the end.
:type  name: ``str``
:param zone: Zone where the requested record is created.
:type  zone: :class:`Zone`
:param type: DNS record type (A, AAAA, ...).
:type  type: :class:`RecordType`
:param data: Data for the record (depends on the record type).
:type  data: ``str``
:param extra: Extra attributes. (optional)
:type extra: ``dict``
:rtype: :class:`Record`'

def create_record(self, name, zone, type, data, extra=None):

    ttl = data.get('ttl', 0)
    rrdatas = data.get('rrdatas', [])
    data = {'additions': [{'name': name, 'type': type, 'ttl': int(ttl), 'rrdatas': rrdatas}]}
    request = ('/managedZones/%s/changes' % zone.id)
    response = self.connection.request(request, method='POST', data=data).object
    return self._to_record(response['additions'][0], zone)
