def METHOD_NAME(cls, json_str: str) -> Pig:
    """Returns the object represented by the json string"""
    instance = Pig.construct()
    error_messages = []
    match = 0
    # deserialize data into BasquePig
    try:
        instance.actual_instance = BasquePig.METHOD_NAME(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    # deserialize data into DanishPig
    try:
        instance.actual_instance = DanishPig.METHOD_NAME(json_str)
        match += 1
    except (ValidationError, ValueError) as e:
        error_messages.append(str(e))
    if match > 1:
        # more than 1 match
        raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
    elif match == 0:
        # no match
        raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
    else:
        return instance