def update(
            self, alert_condition_nrql_id, policy_id, name=None, threshold_type=None, query=None,
            since_value=None, terms=None, expected_groups=None, value_function=None,
            runbook_url=None, ignore_overlap=None, enabled=True):
        conditions_nrql_dict = self.list(policy_id)
        target_condition_nrql = None
        for condition in conditions_nrql_dict['nrql_conditions']:
            if int(condition['id']) == alert_condition_nrql_id:
                target_condition_nrql = condition
                break
        if target_condition_nrql is None:
            raise NoEntityException(
                'Target alert condition nrql is not included in that policy.'
                'policy_id: {}, alert_condition_nrql_id {}'.format(
                    policy_id,
                    alert_condition_nrql_id
                )
            )
        data = {
            'nrql_condition': {
                'type': threshold_type or target_condition_nrql['type'],
                'enabled': target_condition_nrql['enabled'],
                'name': name or target_condition_nrql['name'],
                'terms': terms or target_condition_nrql['terms'],
                'nrql': {
                    'query': query or target_condition_nrql['nrql']['query'],
                    'since_value': since_value or target_condition_nrql['nrql']['since_value'],
                }
            }
        }
        if enabled is not None:
            data['nrql_condition']['enabled'] = str(enabled).lower()
        if runbook_url is not None:
            data['nrql_condition']['runbook_url'] = runbook_url
        elif 'runbook_url' in target_condition_nrql:
            data['nrql_condition']['runbook_url'] = target_condition_nrql['runbook_url']
        if expected_groups is not None:
            data['nrql_condition']['expected_groups'] = expected_groups
        elif 'expected_groups' in target_condition_nrql:
            data['nrql_condition']['expected_groups'] = target_condition_nrql['expected_groups']
        if ignore_overlap is not None:
            data['nrql_condition']['ignore_overlap'] = ignore_overlap
        elif 'ignore_overlap' in target_condition_nrql:
            data['nrql_condition']['ignore_overlap'] = target_condition_nrql['ignore_overlap']
        if value_function is not None:
            data['nrql_condition']['value_function'] = value_function
        elif 'value_function' in target_condition_nrql:
            data['nrql_condition']['value_function'] = target_condition_nrql['value_function']
        if data['nrql_condition']['type'] == 'static':
            if 'value_function' not in data['nrql_condition']:
                raise ConfigurationException(
                    'Alert is set as static but no value_function config specified'
                )
            data['nrql_condition'].pop('expected_groups', None)
            data['nrql_condition'].pop('ignore_overlap', None)
        elif data['nrql_condition']['type'] == 'outlier':
            if 'expected_groups' not in data['nrql_condition']:
                raise ConfigurationException(
                    'Alert is set as outlier but expected_groups config is not specified'
                )
            if 'ignore_overlap' not in data['nrql_condition']:
                raise ConfigurationException(
                    'Alert is set as outlier but ignore_overlap config is not  specified'
                )
            data['nrql_condition'].pop('value_function', None)
        return self._put(
            url='{0}alerts_nrql_conditions/{1}.json'.format(self.URL, alert_condition_nrql_id),
            headers=self.headers,
            data=data
        )