"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

import enum
import sys


class OpenEnumMeta(enum.EnumMeta):
    if sys.version_info >= (3, 11):

        def __call__(
            cls,
            value,
            names=None,
            *values,
            module=None,
            qualname=None,
            type=None,
            start=1,
            boundary=None,
        ):
            if names is not None:
                return super().__call__(
                    value,
                    *values,
                    names=names,
                    module=module,
                    qualname=qualname,
                    type=type,
                    start=start,
                    boundary=boundary,
                )
            try:
                return super().__call__(
                    value,
                    *values,
                    names=names,
                    module=module,
                    qualname=qualname,
                    type=type,
                    start=start,
                    boundary=boundary,
                )
            except ValueError:
                return value
    else:

        def __call__(
            cls, value, names=None, *, module=None, qualname=None, type=None, start=1
        ):
            if names is not None:
                return super().__call__(
                    value,
                    names=names,
                    module=module,
                    qualname=qualname,
                    type=type,
                    start=start,
                )
            try:
                return super().__call__(
                    value,
                    names=names,
                    module=module,
                    qualname=qualname,
                    type=type,
                    start=start,
                )
            except ValueError:
                return value
