def from_json(cls, json_str: str) -> AutoTask:
        """Returns the object represented by the json string"""
        instance = AutoTask.construct()
        error_messages = []
        match = 0

        # use oneOf discriminator to lookup the data type
        _data_type = json.loads(json_str).get("type")
        if not _data_type:
            raise ValueError("Failed to lookup data type from the field `type` in the input.")

        # check if data type is `AutoTaskCrop`
        if _data_type == "AutoTaskCrop":
            instance.actual_instance = AutoTaskCrop.from_json(json_str)
            return instance

        # check if data type is `AutoTaskTiling`
        if _data_type == "AutoTaskTiling":
            instance.actual_instance = AutoTaskTiling.from_json(json_str)
            return instance

        # check if data type is `AutoTaskCrop`
        if _data_type == "CROP":
            instance.actual_instance = AutoTaskCrop.from_json(json_str)
            return instance

        # check if data type is `AutoTaskTiling`
        if _data_type == "TILING":
            instance.actual_instance = AutoTaskTiling.from_json(json_str)
            return instance

        # deserialize data into AutoTaskTiling
        try:
            instance.actual_instance = AutoTaskTiling.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AutoTaskCrop
        try:
            instance.actual_instance = AutoTaskCrop.from_json(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 AutoTask with oneOf schemas: AutoTaskCrop, AutoTaskTiling. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into AutoTask with oneOf schemas: AutoTaskCrop, AutoTaskTiling. Details: " + ", ".join(error_messages))
        else:
            return instance
Returns the object represented by the json string
lightly/openapi_generated/swagger_client/models/auto_task.py