from typing import OrderedDict


def build_pathmatcher(name, defaultServiceUrl):
    """
    This builds and returns a full pathMatcher entry, for appending to an existing URL map.
    Parameters:
    name: The name of the pathMatcher.
    defaultServiceUrl: Denotes the URL requests should go to if none of the path patterns match.
    """
    matcher = OrderedDict()
    matcher['defaultService'] = defaultServiceUrl
    matcher['name'] = name
    return matcher