def convert_collection_to_path_param(collection):
    """
    Convert a list of elements to a valid path parameter by concatenating 
    with ",".
    This is used when calling some endpoints that require a list of instance ids.
    If the collection parameter is not of type ``list``, ``tuple``, ``str`` or ``int``, ``None`` is returned.

    :param collection: Some object that may be a collection
    :return: Either a comma-separated list of the elements or None if invalid type
    """
    if isinstance(collection, list) or isinstance(collection, tuple):
        return ','.join(collection)
    elif isinstance(collection, str) or isinstance(collection, int):
        return str(collection)
    else:
        return None