def METHOD_NAME(
    self,
    project: str,
    access_key: str = None,
    endpoint_store_connection: str = None,
    secret_provider: typing.Callable = None,
) -> ModelEndpointStore:
    """
    Return a ModelEndpointStore object based on the provided enum value.
    :param project:                    The name of the project.
    :param access_key:                 Access key with permission to the DB table. Note that if access key is None
                                       and the endpoint target is from type KV then the access key will be
                                       retrieved from the environment variable.
    :param endpoint_store_connection: A valid connection string for model endpoint target. Contains several
                                      key-value pairs that required for the database connection.
                                      e.g. A root user with password 1234, tries to connect a schema called
                                      mlrun within a local MySQL DB instance:
                                      'mysql+pymysql://root:1234@localhost:3306/mlrun'.
    :param secret_provider:           An optional secret provider to get the connection string secret.
    :return: `ModelEndpointStore` object.
    """
    if self.value == ModelEndpointStoreType.v3io_nosql.value:
        from .kv_model_endpoint_store import KVModelEndpointStore
        # Get V3IO access key from env
        access_key = access_key or mlrun.mlconf.get_v3io_access_key()
        return KVModelEndpointStore(project=project, access_key=access_key)
    # Assuming SQL store target if store type is not KV.
    # Update these lines once there are more than two store target types.
    from .sql_model_endpoint_store import SQLModelEndpointStore
    return SQLModelEndpointStore(
        project=project,
        sql_connection_string=endpoint_store_connection,
        secret_provider=secret_provider,
    )