# Path: elasticmagic/util.py
# def clean_params(params, **kwargs):
#     return {
#         p: v for p, v in chain(params.items(), kwargs.items())
#         if v is not None
#     }


from .util import clean_params
        from .index import Index as ESIndex


class Update(Action):
    __action_name__ = 'update'

    def __init__(self, doc=None, script=None, script_id=None,
                 index=None, doc_type=None,
                 consistency=None, refresh=None,
                 routing=None, parent=None,
                 timestamp=None, ttl=None,
                 version=None, version_type=None,
                 detect_noop=None, retry_on_conflict=None,
                 upsert=None, doc_as_upsert=None,
                 scripted_upsert=None, params=None,
                 **kwargs):
        super(Update, self).__init__(
            doc or {},
            index=index,
            doc_type=doc_type,
            consistency=consistency,
            refresh=refresh,
            routing=routing,
            parent=parent,
            timestamp=timestamp,
            ttl=ttl,
            version=version,
            version_type=version_type,
            retry_on_conflict=retry_on_conflict,
            **kwargs
        )

# Path: elasticmagic/util.py
# def clean_params(params, **kwargs):
#     return {
#         p: v for p, v in chain(params.items(), kwargs.items())
#         if v is not None
#     }


# Path: elasticmagic/actions.py
from .util import clean_params
        from .index import Index as ESIndex



class Update(Action):
    __action_name__ = 'update'

    def __init__(self, doc=None, script=None, script_id=None,
                 index=None, doc_type=None,
                 consistency=None, refresh=None,
                 routing=None, parent=None,
                 timestamp=None, ttl=None,
                 version=None, version_type=None,
                 detect_noop=None, retry_on_conflict=None,
                 upsert=None, doc_as_upsert=None,
                 scripted_upsert=None, params=None,
                 **kwargs):
        super(Update, self).__init__(
            doc or {},
            index=index,
            doc_type=doc_type,
            consistency=consistency,
            refresh=refresh,
            routing=routing,
            parent=parent,
            timestamp=timestamp,
            ttl=ttl,
            version=version,
            version_type=version_type,
            retry_on_conflict=retry_on_conflict,
            **kwargs
        )

        self.source_params = clean_params({