def update_record(self, identifier, type=None, name=None, content=None):
    records = []
    if identifier:
        records = self.list_records()
        records = [record for record in records if (record['id'] == identifier)]
    else:
        records = self.list_records(type, name)
    if (not records):
        raise Exception('No record found for identifer: {0}'.format(identifier))
    if (len(records) > 1):
        LOGGER.warn('Multiple records have been found for given parameters. Only first one will be updated (id: {0})'.format(records[0]['id']))
    data = {'type': type, 'name': self._relative_name(name), 'value': content}
    if (not type):
        data['type'] = records[0]['type']
    if (not name):
        data['name'] = self._relative_name(records[0]['name'])
    if (not content):
        data['value'] = records[0]['content']
    result = self._post('/{0}/records'.format(self.options['domain']), data)
    self._delete('/{0}/records/{1}'.format(self.options['domain'], records[0]['id']))
    LOGGER.debug('update_record: %s => %s', records[0]['id'], result['uid'])
    return True
def update_record(self, identifier, type=None, name=None, content=None):
    records = []
    if identifier:
        records = self.list_records()
        records = [record for record in records if (record['id'] == identifier)]
    else:
        records = self.list_records(type, name)
    if (not records):
        raise Exception('No record found for identifer: {0}'.format(identifier))
    if (len(records) > 1):
        LOGGER.warn('Multiple records have been found for given parameters. Only first one will be updated (id: {0})'.format(records[0]['id']))
    data = {'type': type, 'name': self._relative_name(name), 'value': content}
    if (not type):
        data['type'] = records[0]['type']
    if (not name):
        data['name'] = self._relative_name(records[0]['name'])
    if (not content):
        data['value'] = records[0]['content']
    result = self._post('/{0}/records'.format(self.options['domain']), data)
    self._delete('/{0}/records/{1}'.format(self.options['domain'], records[0]['id']))
    LOGGER.debug('update_record: %s => %s', records[0]['id'], result['uid'])
    return True