'Construct a datastore index instance.
Args:
index_id: Required long; Uniquely identifies the index
kind: Required string; Specifies the kind of the entities to index
has_ancestor: Required boolean; indicates if the index supports a query
that filters entities by the entity group parent
properties: Required list of (string, int) tuples; The entity properties
to index. First item in a tuple is the property name and the second
item is the sorting direction (ASCENDING|DESCENDING).
The order of the properties is based on the order in the index.'

def __init__(self, index_id, kind, has_ancestor, properties):

    argument_error = datastore_errors.BadArgumentError
    datastore_types.ValidateInteger(index_id, 'index_id', argument_error, zero_ok=True)
    datastore_types.ValidateString(kind, 'kind', argument_error, empty_ok=True)
    if (not isinstance(properties, (list, tuple))):
        raise argument_error('properties    must    be    a    list    or    a    tuple')
    for (idx, index_property) in enumerate(properties):
        if (not isinstance(index_property, (list, tuple))):
            raise argument_error(('property[%d]    must    be    a    list    or    a    tuple' % idx))
        if (len(index_property) != 2):
            raise argument_error(('property[%d]    length    should    be    2    but    was    %d' % (idx, len(index_property))))
        datastore_types.ValidateString(index_property[0], 'property    name', argument_error)
        _BaseIndex.__ValidateEnum(index_property[1], (self.ASCENDING, self.DESCENDING), 'sort    direction')
    self.__id = long(index_id)
    self.__kind = kind
    self.__has_ancestor = bool(has_ancestor)
    self.__properties = properties
