
    $g                        d dl mZ d dlmZ d dlmZmZmZ ddlm	Z	 ddl
mZ erd dlmZ ddlmZ  G d	 d
e	          ZdS )    )annotations)cached_property)TYPE_CHECKINGOptionalType   )StrawberryException)SourceFinder)Enum)ExceptionSourcec                  8     e Zd Zd fdZed	d            Z xZS )
ObjectIsNotAnEnumErrorcls
Type[Enum]returnNonec                    || _         d|j         d| _        d|j         d| _        d| _        d| _        t                                          | j                   d S )NzJstrawberry.enum can only be used with subclasses of Enum. Provided object z is not an enum.zVstrawberry.enum can only be used with subclasses of Enum. Provided object `[underline]z[/]` is not an enum.zclass defined herezCTo fix this error, make sure your class is a subclass of enum.Enum.)r   __name__messagerich_messageannotation_message
suggestionsuper__init__)selfr   	__class__s     k/var/www/html/netbox-4.1.3/venv/lib/python3.11/site-packages/strawberry/exceptions/object_is_not_an_enum.pyr   zObjectIsNotAnEnumError.__init__   s    >"|> > > 	
N+.<N N N 	 #7Q 	 	&&&&&    Optional[ExceptionSource]c                d    | j         d S t                      }|                    | j                   S )N)r   r
   find_class_from_object)r   source_finders     r   exception_sourcez'ObjectIsNotAnEnumError.exception_source!   s.    84$33DH===r   )r   r   r   r   )r   r   )r   
__module____qualname__r   r   r#   __classcell__)r   s   @r   r   r      s]        ' ' ' ' ' '" > > > _> > > > >r   r   N)
__future__r   	functoolsr   typingr   r   r   	exceptionr	   utils.source_finderr
   enumr   r#   r   r    r   r   <module>r.      s    " " " " " " % % % % % % 0 0 0 0 0 0 0 0 0 0 * * * * * * - - - - - - 2111111> > > > >0 > > > > >r   