import json


def cast_object_to_string(object, object_type):

    """ Whenever object_type is either a list or dictionary, apply json.dumps()
    to cast it to a string, otherwise, apply str().
    """

    if object_type in [list, dict]:
        return json.dumps(object)
    else:
        return str(object)