# This file was auto-generated by Fern from our API Definition.

import typing

from ..core import enum

T_Result = typing.TypeVar("T_Result")


class SklearnSerializationFormat(enum.StrEnum):
    """
    Serialization format used to save the sklearn model
    """

    CLOUDPICKLE = "cloudpickle"
    JOBLIB = "joblib"
    PICKLE = "pickle"

    def visit(
        self,
        cloudpickle: typing.Callable[[], T_Result],
        joblib: typing.Callable[[], T_Result],
        pickle: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is SklearnSerializationFormat.CLOUDPICKLE:
            return cloudpickle()
        if self is SklearnSerializationFormat.JOBLIB:
            return joblib()
        if self is SklearnSerializationFormat.PICKLE:
            return pickle()
