# This file auto-generated by `generate_schema_interface.py`.
# Do not modify this file directly.

import traitlets as T
from ..baseobject import BaseObject
from .aggregateop import AggregateOp
from .sortorder import SortOrder


class SortField(BaseObject):
    """Wrapper for Vega-Lite SortField definition.
    
    Attributes
    ----------
    field: Unicode
        The field name to aggregate over.
    op: AggregateOp
        The sort aggregation operator.
    order: SortOrder
        
    """
    field = T.Unicode(allow_none=True, default_value=None, help="""The field name to aggregate over.""")
    op = AggregateOp(allow_none=True, default_value=None, help="""The sort aggregation operator.""")
    order = SortOrder(allow_none=True, default_value=None)
    
    def __init__(self, field=None, op=None, order=None, **kwargs):
        kwds = dict(field=field, op=op, order=order)
        kwargs.update({k:v for k, v in kwds.items() if v is not None})
        super(SortField, self).__init__(**kwargs)