# coding: utf-8

"""
Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
"""
from __future__ import annotations

from enum import Enum
from json import loads
from typing import Self


class RemoveWordsIfNoResults(str, Enum):
    """
    Strategy to [remove words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/) from the query when it doesn't match any hits.
    """

    """
    allowed enum values
    """
    NONE = "none"
    LASTWORDS = "lastWords"
    FIRSTWORDS = "firstWords"
    ALLOPTIONAL = "allOptional"

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of RemoveWordsIfNoResults from a JSON string"""
        return cls(loads(json_str))
