def get_link_href(result_object, link_relation):
    """
    Given a result_object (returned by a previous API call), return
    the link href for a link relation.

    'result_object' a JSON object returned by a previous API call. May not
    be None.
    'link_relation' the link relation for which href is required.

    Returns None if the link does not exist.
    """
    assert result_object is not None
    result = None
    link = result_object['_links'].get(link_relation)
    if link:
        result = link.get('href')
    return result
