� K�gP��"��ddlZddlZddlZddlZddlZddlmZmZddl m Z m Z ddl m Z mZmZmZmZmZmZmZmZmZmZmZmZddlmZddlmZmZmZm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'dd l(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1dd l2m3Z3m4Z4m5Z5m6Z6dd l7m8Z8m9Z9dd l:m;Z;m<Z<m=Z=m>Z>m?Z?ddl@mAZAddlBmCZCddlDmEZEddlFmGZGddlHmIZIddlJmKZKmLZLddlMmNZNmOZOmPZPmQZQmRZRmSZSddlMmTZTddlUmVZVmWZWmXZXmYZYddlZm[Z[ddl\m]Z]m^Z^m_Z_ddd�de de`de`de`de f d �Zad!eXe d"eXe deXe fd#�Zbdddd$dddd$d%�d&eed'e d(ee9d)ee9d*e`de`de`de`d+e`de fd,�Zcd-e'd.eede fd+e`de fd/�Zedde$eK��dddd$dddddf d-e'd0eed1eefd2eeeLe%fd3eed4ee9d5ee9d6e`d7e`d8e`d9e`d:ee d;e`deeIgee e eLfffd<�Zg dDd-e'd:ee d;e`dee[gee e e fffd=�ZhGd>�d?eCji��ZjGd@�dAeCjk��ZlGdB�dCeCjm��ZndS)E�N)�AsyncExitStack�asynccontextmanager)�Enum�IntEnum) �Any� AsyncIterator�Callable� Coroutine�Dict�List�Mapping�Optional�Sequence�Set�Tuple�Type�Union)�params)� ModelField� Undefined�_get_model_config� _model_dump�_normalize_errors�lenient_issubclass)�Default�DefaultPlaceholder)� Dependant)�_should_embed_body_fields�get_body_field� get_dependant�get_flat_dependant�get_parameterless_sub_dependant�get_typed_return_annotation�solve_dependencies)�jsonable_encoder)� FastAPIError�RequestValidationError�ResponseValidationError�WebSocketRequestValidationError)�DecoratedCallable�IncEx)�create_cloned_field�create_model_field�generate_unique_id�get_value_or_default�is_body_allowed_for_status_code)� BaseModel)�routing)�run_in_threadpool)� HTTPException)�Request)� JSONResponse�Response)� BaseRoute�Match� compile_path�get_name�request_response�websocket_session)�Mount)�AppType�ASGIApp�Lifespan�Scope�� WebSocket)� Annotated�Doc� deprecatedF)�exclude_defaults� exclude_none�res� exclude_unsetrHrI�returnc�����t|t��r6tt|��dd��}|r|St |d������St|t ��r���fd�|D��St|t ��r"���fd�|���D��Stj |��rtj |��S|S)N�read_with_orm_modeT)�by_aliasrKrHrIc�6��g|]}t|��������S��rKrHrI��_prepare_response_content)�.0�itemrHrIrKs ����_/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fastapi/routing.py� <listcomp>z-_prepare_response_content.<locals>.<listcomp>fsF��� � � �� &��+�!1�)�  � � � � � �c �>��i|]\}}|t|��������SrQrS)rU�k�vrHrIrKs ���rW� <dictcomp>z-_prepare_response_content.<locals>.<dictcomp>psM��� � � ���1� �(��+�!1�)� ��� � � rY) � isinstancer1�getattrrr�list�dict�items� dataclasses� is_dataclass�asdict)rJrKrHrIrNs ``` rWrTrTOs4������#�y�!�!�$'�$�%6�s�%;�%;�=Q�SW�X�X�� � � �J�� ��'�-�%�  � � � � �C�� � �'� � � � � � �� � � � � �C�� � � '� � � � � � �� � � � � � � � � � !�#� &� &�'��!�#�&�&�&� �JrY�original_context�nested_contextc ����tdtdtttt t ff��fd� ��}|S)N�apprLc��K��|��4�d{V��}�|��4�d{V��}|�|�dWV�n i|pi�|pi�WV�ddd���d{V��n#1�d{V��swxYwYddd���d{V��dS#1�d{V��swxYwYdS�N�)ri�maybe_original_state�maybe_nested_statergrfs ��rW�merged_lifespanz0_merge_lifespan_context.<locals>.merged_lifespan�s�����$�#�C�(�(� Y� Y� Y� Y� Y� Y� Y�,@�%�~�c�*�*� Y� Y� Y� Y� Y� Y� Y�.@�%�-�2F�2N��J�J�J�J�J�X�0�6�B�X�<P�<V�TV�X�X�X�X�X�  Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y���� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y� Y���� Y� Y� Y� Y� Y� Ys3�A5�A�A5� A �A5�A �A5�5 A?�A?)rr?rrr �strr)rfrgros`` rW�_merge_lifespan_contextrq~sh�����Y� �Y� �x���S�� 1�2� 3�Y�Y�Y�Y�Y�Y���Y� �rYT)�field�include�excluderOrKrHrI� is_coroutinerr�response_contentrsrtrOruc ��:K�|�rg} t|d��st||||���}|r|�|id���\} } n!t|j|id����d{V��\} } t | t ��r| �| ��n| r| �| ��| rtt| ��|����t|d��r|� | ||||||���St| ||||||���St|��S)N� serializerR)�response)�loc)�errors�body)rsrtrOrKrHrI) �hasattrrT�validater3r^r`�extend�appendr(rrxr%) rrrvrsrtrOrKrHrIrur{�value�errors_s rW�serialize_responser��s����� �.2����u�k�*�*� �8� �+�!1�)�  � � � � � �"�^�^�,<�b�m�^�T�T�N�E�7�7�#4��� 0�"�-�$�$�$�������N�E�7� �g�t� $� $� #� �M�M�'� "� "� "� "� � #� �M�M�'� "� "� "� � �)�(��0�0�7G���� � �5�+� &� &� ��?�?����!�+�!1�)�#��� � � ����'�-�%� � � � � � 0�1�1�1rY� dependant�valuesc��K�|j� Jd���|r|jdi|���d{V��St|jfi|���d{V��S)N�!dependant.call must be a functionrl)�callr3�r�r�rus rW�run_endpoint_functionr��s|���� �>� %� %�'J� %� %� %��A�#�Y�^�-�-�f�-�-�-�-�-�-�-�-�-�&�y�~�@�@��@�@�@�@�@�@�@�@�@rY� body_field� status_code�response_class�response_field�response_model_include�response_model_exclude�response_model_by_alias�response_model_exclude_unset�response_model_exclude_defaults�response_model_exclude_none�dependency_overrides_provider�embed_body_fieldsc �<��������� � � � �����j� Jd���tj�j����ot�jt j���t|t��r|j�n|�dtdtf���� � ������ � ���fd� } | S)Nr��requestrLc ����K�d}t��4�d{V��} d}��r%�r5|����d{V��}|�|j��n�|����d{V��}|r�t }|j�d��}|s|����d{V��}n�tj � ��}||d<|� ��dkrI|� ��}|dks|�d��r|����d{V��}|t kr|}n|}np#tj$r3} t!dd| jfdid| jid �g| j� ��} | | �d} ~ wt($r�t*$r} t)d d � ��} | | �d} ~ wwxYwg} t��4�d{V��} t-|�|�| �����d{V��}|j} | s�t1�|j�����d{V��}t5|t6��r|j� |j|_|}n�d|ji}�!r�!n |jj}|�||d<|jjr|jj|d<tA�|� �������� � �d{V��}�|fi|��}tC|j��sd|_|jj"�#|jjj"��ddd���d{V��n#1�d{V��swxYwY| r t!tI| ��|� ��} | � ddd���d{V��n#1�d{V��swxYwY|�tKd���|S)Nz content-type� application�jsonz+json� json_invalidr|zJSON decode error�error)�typerz�msg�input�ctx)r|i�z#There was an error parsing the body)r��detail)r�r�r|r��async_exit_stackr�r�� backgroundr�) rrrvrsrtrOrKrHrIrurYa}No response object was returned. There's a high chance that the application code is raising an exception and a dependency with yield has a block with a bare except, or a block with except Exception, and is not raising the exception again. Read more about it in the docs: https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#dependencies-with-yield-and-except)&r�form�push_async_callback�closer|r�headers�getr��email�message�Message�get_content_maintype�get_content_subtype�endswith�JSONDecodeErrorr'�posr��docr4� Exceptionr$r{r�r�r^r7r��background_tasksryr�r�r0�rawrrr&)"r�ry� file_stackr|� body_bytes� json_body�content_type_valuer��subtype�e�validation_error� http_errorr{r�� solved_result� raw_response� response_args�current_status_code�content�actual_response_classr�r�r�r�� is_body_formrur�r�r�r�r�r�r�r�s" ���������������rWriz get_request_handler.<locals>.app�s�����*.��!�#�#�h '�h '�h '�h '�h '�h '�h '�z�- (� ���2�#�2�%,�\�\�^�^�3�3�3�3�3�3��"�6�6�t�z�B�B�B�B�+2�<�<�>�>�%9�%9�%9�%9�%9�%9� �%�2�-6�I�18��1D�1D�^�1T�1T�.�#5�I�29�,�,�.�.�,@�,@�,@�,@�,@�,@� � �*/�-�*?�*?�*A�*A��:L��� 7�#*�#?�#?�#A�#A�]�#R�#R�.5�.I�.I�.K�.K�G�'.�&�'8�'8�G�<L�<L�W�<U�<U�'8�:A�,�,�.�.�4H�4H�4H�4H�4H�4H� �(�I�5�5�'0���'1�����'� .� .� .�#9�%3�$*�A�E�?�#6�%'�$+�Q�U�#3� ����� $� $� $� �'�A�-����� � � � ��� (� (� (�*� #�,Q���� �!�a�'�����  (���� !#�F�%�'�'�3 X�3 X�3 X�3 X�3 X�3 X�3 X�+;�&8�#�'��2O�%5�&7� '�'�'�!�!�!�!�!�!� �'�-���)X�)>�"+�,�3�%1�*�*�*�$�$�$�$�$�$�L� "�,��9�9�#X�'�2�:�6C�6T�L�3�#/���)�-�*H�9� � +�D�K�K�!.�!7�!C�,� /�:�;N�M�-�8�(�1�=�� -� 6� B�*�-�8�);�"0�-9�$:�$:�%<�*F�-L�)D�)5� )� )� )� #� #� #� #� #� #��$9�#8��#R�#R�M�#R�#R��>�x�?S�T�T�0�,/�H�M� �(�,�3�3�M�4J�4R�4V�W�W�W�g3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X�3 X����3 X�3 X�3 X�3 X�h� '�#9�%�f�-�-�D�$�$�$� �'�&�&�Qh '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '�h '����h '�h '�h '�h '�R � ��G��� ��sf�L=�D*E�L=�F4�.F�F4�F/�/F4�4L=� DK7�%L=�7 L �L=�L �%L=�= M� M) r��asyncio�iscoroutinefunctionr^� field_infor�Formrr�r5r7)r�r�r�r�r�r�r�r�r�r�r�r�r�rir�r�rus``` ````````` @@@rW�get_request_handlerr��s ����������������� �>� %� %�'J� %� %� %��.�y�~�>�>�L��P�*�Z�-B�F�K�"P�"P�L��.�"4�5�5�/�0>�0D��� .��s�7�s�x�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�j �JrYc�.����dtddf���fd� }|S)N� websocketrLc��h�K�t��4�d{V��}||jd<t|��|�����d{V��}|jr!t t |j������j� Jd����jdi|j���d{V��ddd���d{V��dS#1�d{V��swxYwYdS)N�fastapi_astack)r�r�r�r�r�r�rl)r�scoper$r{r)rr�r�)r�r�r�r�r�r�s ���rWrizget_websocket_app.<locals>.appms������!�#�#� 9� 9� 9� 9� 9� 9� 9�'7�1A�I�O�,� -�"4�!�#�.K�!1�"3� #�#�#�������M��#� �5�%�m�&:�;�;�����>�-�-�/R�-�-�-� �)�.�8�8�=�#7�8�8� 8� 8� 8� 8� 8� 8� 8�# 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9� 9���� 9� 9� 9� 9� 9� 9s�A6B!�! B+�.B+rC)r�r�r�ris``` rW�get_websocket_appr�hsB����� 9�Y�9�4�9�9�9�9�9�9�9�9�( �JrYc ���eZdZdddd�dededefdeedeeej deed df d �Z d e d e e e ff�fd � Z�xZS) �APIWebSocketRouteN)�name� dependenciesr��path�endpoint.r�r�r�rLc�Z�||_||_|�t|��n||_t |pg��|_t |��\|_|_|_ t|j|j���|_ |jddd�D]6}|j j� dt||j������7t|j ��|_t!|jj��|_t't)|j ||j�����|_dS)N�r�r������r��dependsr�)r�r�r�)r�r�r;r�r`r�r:� path_regex� path_format�param_convertorsr r��insertr"r!�_flat_dependantr� body_params�_embed_body_fieldsr=r�ri)�selfr�r�r�r�r�r�s rW�__init__zAPIWebSocketRoute.__init__�s0���� � �� �*.�,�H�X�&�&�&�D�� � ��!3��4�4���CO�PT�CU�CU�@����)�4�+@�&�D�,<�4�=�Q�Q�Q����(���2��.� � �G� �N� '� .� .��/��d�FV�W�W�W� � � � � 2�$�.�A�A���";� � � ,�# �# ���%� ��.�.K�"&�"9� � � � � ����rYr�c�~��t���|��\}}|tjkr||d<||fS�N�route��super�matchesr9�NONE�r�r��match� child_scope� __class__s �rWr�zAPIWebSocketRoute.matches��?���"�W�W�_�_�U�3�3���{� �E�J� � �#'�K�� ��k�!�!rY)�__name__� __module__� __qualname__rpr rrrr�Dependsr�rBrr9r�� __classcell__�r�s@rWr�r��s�������� #�;?�7;� � � �� ��3��8�$� � �s�m�  � �x���7�8�  �(0��}� � � � � � �@"�U�"�u�U�E�\�':�"�"�"�"�"�"�"�"�"�"rYr�c8����eZdZed��ddddddddddddddddddee��dddee��d�dededefd ed e e d e e e ee fd e eejd e ede edede ee e efeeeffde ede ede e eee efde ede ede edededededede eeefde ede e ede eeefd e edgefefd!df6d"�Zd!eegeeeefffd#�Zd$ed!eeeff�fd%� Z �xZ!S)&�APIRouteN�Successful ResponseTF)�response_modelr��tagsr��summary� description�response_description� responsesrGr��methods� operation_idr�r�r�r�r�r��include_in_schemar�r�� callbacks� openapi_extra�generate_unique_id_functionr�r�.r�r�r�r�r�r�r�r�rGr�r�rr�r�r�r�r�r�rr�r�rrrrLc�6�||_||_t|t��r)t |��}t |t ��rd}n|}||_||_| |_ | |_ ||_ ||_ ||_ ||_||_||_||_||_||_||_||_||_||_|pg|_| pi|_| �t5|��n| |_t9|��\|_|_|_| �dg} d�| D��|_ t|t��r|j!}n|}|j p ||��|_"t|tF��rtI|��}||_%|jr]tM|��sJd|�d����d|j"z}tO||jd���|_(tS|j(��|_*nd|_(d|_*tW|pg��|_,|pt[j.|jj/pd��|_0|j0�1d ��d �2��|_0i}|j�3��D]|\}} t| th��s Jd ���| �5d ��}!|!rAtM|��sJd|�d����d|�d |j"��}tO||!d���}"|"||<�}|r||_6ni|_6to|��s Jd���tq|j|j���|_9|j,ddd�D]6}#|j9j,�:d tw|#|j������7ty|j9��|_=t}|j=j?��|_@t�|j=|j"|j@���|_Bt�|�D����|_EdS)N�GETc�6�h|]}|�����Srl)�upper)rU�methods rW� <setcomp>z$APIRoute.__init__.<locals>.<setcomp>�s ��!G�!G�!G�V�&�,�,�.�.�!G�!G�!GrYz Status code z must not have a response body� Response_� serialization)r��type_�mode�� rz%An additional response must be a dict�model�_zAn endpoint must be a callabler�r�r�)�flat_dependantr�r�)Fr�r�r^rr#rr7r�r�r�rGrr�r�r�r�r�r�rr�r�rrrr�r�r;r�r:r�r�r�r�r�� unique_idr�intr�r0r-r�r,�secure_cloned_response_fieldr`r��inspect�cleandoc�__doc__r��split�striprbrar��response_fields�callabler r�r�r"r!r�rr�r�rr�r<�get_route_handlerri)$r�r�r�r�r�r�r�r�r�r�r�rGr�r�rr�r�r�r�r�r�rr�r�rrr�return_annotation�current_generate_unique_id� response_namer�additional_status_coderyrr�r�s$ rWr�zAPIRoute.__init__�s���D�� � �� � �n�&8� 9� 9� 3� ;�H� E� E� �!�"3�X�>�>� 3�!%���!2��,����� �$8��!�$���(���&<��#�&<��#�'>��$�,H��)�/N��,�+F��(�!2���,���-J��*�"���*���+F��(��J�B�� �"��b���*.�,�H�X�&�&�&�D�� �CO�PT�CU�CU�@����)�4�+@� �?��g�G�!G�!G�w�!G�!G�!G�� � �1�3E� F� F� E�+�1� '� &�*E� &��*�N�.H�.H��.N�.N��� �k�7� +� +� +��k�*�*�K�&��� � � 5�2���� J� J�I�k�I�I�I� J� J��(�$�.�8�M�"4�"��)�$�#�#�#�D� �$�D�$7�8�8� � -� -�#'�D� �04�D� -� ��!3��4�4���&�W�'�*:�4�=�;P�;V�TV�*W�*W��� �+�1�1�$�7�7��:�@�@�B�B�����04��0D�0D�0F�0F� I� I� ,� "�H��h��-�-� V� V�/V� V� V�-��L�L��)�)�E�� I�6�*���Y�Y�X�"8�X�X�X�Y�Y��!V�,B� U� U�T�^� U� U� �!3�&�e�/�"�"�"��;I�� 6�7�� � &�FU�D� � �#%�D� ���!�!�C�C�#C�C�C�!�&�D�,<�4�=�Q�Q�Q����(���2��.� � �G� �N� '� .� .��/��d�FV�W�W�W� � � � � 2�$�.�A�A���";� � � ,�# �# ���)��/���"�5� � � ��� $�D�$:�$:�$<�$<�=�=����rYc��t|j|j|j|j|j|j|j|j|j |j |j |j |j �� � S)N) r�r�r�r�r�r�r�r�r�r�r�r�r�)r�r�r�r�r�rr�r�r�r�r�r�r�r�)r�s rWrzAPIRoute.get_route_handler;se��"��n����(��.��<�#'�#>�#'�#>�$(�$@�)-�)J�,0�,P�(,�(H�*.�*L�"�5� � � � rYr�c�~��t���|��\}}|tjkr||d<||fSr�r�r�s �rWr�zAPIRoute.matchesLr�rY)"r�r�r�rr6r.rpr rrrr rrrrr�r �boolrr+rr7rr8r�r5r rrBrr9r�r�r�s@rWr�r��s ������� &�g�d�m�m�%)�15�;?�!%�%)�$9�EI�%)�"�8<�&*�26�26�(,�-2�05�,1�"&�DK�G� �E �E �8<�/3�26� �G�&� '� '�AL>�L>�L>��L>��3��8�$�L>� � L>� �c�]� L>��t�E�#�t�)�,�-�.�L>��x���7�8�L>��#��L>��c�]�L>�"�L>��D��s�C�x��$�s�C�x�.�!@�A�B�L>��T�N�L>��s�m�L>��%��C��$�s�)� 3�4�5�L>� �s�m�!L>�"!)���#L>�$!)���%L>�&"&�'L>�('+�)L>�**.�+L>�,&*�-L>�. �/L>�0�d�8�n�.@�@�A�1L>�6(0��}�7L>�8�D��O�,�9L>�: ��S�#�X��/�;L>�<&+� �j�\�3�&� '�);� ;�& �=L>�B �CL>�L>�L>�L>�\ �8�W�I�y��c�8�AS�7T�,T�#U� � � � �""�U�"�u�U�E�\�':�"�"�"�"�"�"�"�"�"�"rYr�c8� 7��eZdZdZdddee��ddddddedddddee��d�dee e d��fdee e e e efe d ��fd ee eeje d ��fd eeee d ��fdee ee ee fee effe d��fdee e ee d��fdee e ee d��ed��fdeee d��fdee ee d��fdee ee d��fdeeee d��fdee eegefe d��fdee eegefe d ��fd!ee eee d"��fd#ee ee d$��fd%eee d&��fd'eeege fe d(��fd)df$�fd*�Z dud+e d,e e e d-e e d%ed)eegeff d.�Zed��dddddd/dddddddd0d0d0dee��ddddee��d1�d+e d2ed3efd4ed5e ede e e e efd e eejd6e e d7e e d8e de ee ee fee effd#e ed,e e e e e e fd9e e d:e e!d;e e!d<ed=ed>ed?ed%ed@e eee"fd-e e dAe eede e edBe ee efd'e eege fe"fd)df6dC�Z#ed��dddddd/dddddddd0d0d0dee��dddee��dD�d+e d4ed5e ede e e e efd e eejd6e e d7e e d8e de ee ee fee effd#e ed,e e e d9e e d:e e!d;e e!d<ed=ed>ed?ed%ed@eed-e e de e edBe ee efd'eege fd)eegeff2dE�Z$ dvddF�d+e d2ed3efd-e e d e eejd)df dG�Z% dvddF�d+ee e dH��fd-ee e e dI��fd ee eeje dJ��fd)eegeffdK�Z& dvd+e d-e e dfd)eegeffdL�Z'dddee��ddddee��dM� dNede dO��fdee e d��fdee e e e efe d ��fd ee eeje d ��fd eeee d ��fdee ee ee fee effe d��fdee e ee d��fd#ee ee d$��fd%eee dP��fd'eeege fe d(��fd)dfdQ�Z(ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0di�Z)ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0dj�Z*ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0dk�Z+ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0dl�Z,ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0dm�Z-ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0dn�Z.ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0do�Z/ed��dddddd/ddddddd0d0d0dee��dddee��dR�d+ee e dS��fd4eee dT��fd5ee ee dU��fdee e e e efe dV��fd ee eeje dW��fd6ee e e dX��fd7ee e e dY��fd8ee e dZ��fdee ee ee fee effe d[��fd#ee ee d\��fd9ee e e d]��fd:ee e!e d^��fd;ee e!e d_��fd<eee d`��fd=eee da��fd>eee db��fd?eee dc��fd%eee dd��fd@eeee de��fd-ee e e df��fdee e ee dg��fdBee ee efe dh��fd'eeege fe d(��fd)eegeff0dp�Z0edq��dree e ds��fd)eegeffdt���Z1�xZ2S)w� APIRoutera� `APIRouter` class, used to group *path operations*, for example to structure an app in multiple files. It would then be included in the `FastAPI` app, or in another `APIRouter` (ultimately included in the app). Read more about it in the [FastAPI docs for Bigger Applications - Multiple Files](https://fastapi.tiangolo.com/tutorial/bigger-applications/). ## Example ```python from fastapi import APIRouter, FastAPI app = FastAPI() router = APIRouter() @router.get("/users/", tags=["users"]) async def read_users(): return [{"username": "Rick"}, {"username": "Morty"}] app.include_router(router) ``` rNT)�prefixr�r��default_response_classr�r�routes�redirect_slashes�defaultr�� route_class� on_startup� on_shutdown�lifespanrGrrr(z'An optional path prefix for the router.r�a� A list of tags to be applied to all the *path operations* in this router. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/). r�a� A list of dependencies (using `Depends()`) to be applied to all the *path operations* in this router. Read more about it in the [FastAPI docs for Bigger Applications - Multiple Files](https://fastapi.tiangolo.com/tutorial/bigger-applications/#include-an-apirouter-with-a-custom-prefix-tags-responses-and-dependencies). r)a  The default response class to be used. Read more in the [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/#default-response-class). r�a* Additional responses to be shown in OpenAPI. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Additional Responses in OpenAPI](https://fastapi.tiangolo.com/advanced/additional-responses/). And in the [FastAPI docs for Bigger Applications](https://fastapi.tiangolo.com/tutorial/bigger-applications/#include-an-apirouter-with-a-custom-prefix-tags-responses-and-dependencies). rao OpenAPI callbacks that should apply to all *path operations* in this router. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for OpenAPI Callbacks](https://fastapi.tiangolo.com/advanced/openapi-callbacks/). r*a  **Note**: you probably shouldn't use this parameter, it is inherited from Starlette and supported for compatibility. --- A list of routes to serve incoming HTTP and WebSocket requests. a5 You normally wouldn't use this parameter with FastAPI, it is inherited from Starlette and supported for compatibility. In FastAPI, you normally would use the *path operation methods*, like `router.get()`, `router.post()`, etc. r+z� Whether to detect and redirect slashes in URLs when the client doesn't use the same format. r,z� Default function handler for this router. Used to handle 404 Not Found errors. r�z� Only used internally by FastAPI to handle dependency overrides. You shouldn't need to use it. It normally points to the `FastAPI` app object. r-a4 Custom route (*path operation*) class to be used by this router. Read more about it in the [FastAPI docs for Custom Request and APIRoute class](https://fastapi.tiangolo.com/how-to/custom-request-and-route/#custom-apiroute-class-in-a-router). r.z� A list of startup event handler functions. You should instead use the `lifespan` handlers. Read more in the [FastAPI docs for `lifespan`](https://fastapi.tiangolo.com/advanced/events/). r/a A list of shutdown event handler functions. You should instead use the `lifespan` handlers. Read more in the [FastAPI docs for `lifespan`](https://fastapi.tiangolo.com/advanced/events/). r0a' A `Lifespan` context manager handler. This replaces `startup` and `shutdown` functions with a single context manager. Read more in the [FastAPI docs for `lifespan`](https://fastapi.tiangolo.com/advanced/events/). rGaa Mark all *path operations* in this router as deprecated. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/). ra� To include (or not) all the *path operations* in this router in the generated OpenAPI. This affects the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Query Parameters and String Validations](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#exclude-from-openapi). ra� Customize the function used to generate unique IDs for the *path operations* shown in the generated OpenAPI. This is particularly useful when automatically generating clients or SDKs for your API. Read more about it in the [FastAPI docs about how to Generate Clients](https://fastapi.tiangolo.com/advanced/generate-clients/#custom-generate-unique-id-function). rLc���t���||| | | |���|r>|�d��s Jd���|�d��r Jd���||_|pg|_t |pg��|_||_||_ |pi|_ |pg|_ | |_ | |_ ||_||_dS)N)r*r+r,r.r/r0�/�!A path prefix must start with '/'�FA path prefix must not end with '/', as the routes will start with '/')r�r�� startswithr�r(r�r`r�rGrr�rr�r-r)r)r�r(r�r�r)r�rr*r+r,r�r-r.r/r0rGrrr�s �rWr�zAPIRouter.__init__ns���n ������-��!�#�� � � � � � X��$�$�S�)�)� N� N�+N� N� N�)������� X� X�W� X� X���� �,0�J�B�� � ��!3��4�4���$���!2���"��b���"��b���-J��*�&���&<��#�+F��(�(�(rYr�r�r�c�@������dtdtf�����fd� }|S)N�funcrLc�<�����|������|S)N)r�r�r)� add_route)r7rr�r�r�r�s �����rW� decoratorz"APIRouter.route.<locals>.decoratores4��� �N�N�����"3� � � � ��KrY�r*)r�r�r�r�rr:s````` rWr�zAPIRouter.route^sQ������� �-� �2C� � � � � � � � � � ��rYr�F�r�r�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r��route_class_overriderrrr�.r�r�r�r�r�rr�r�r�r�r�r�r�r=rc��|p|j}| pi} i|j�| �}t||j��}|j���}|r|�|��|j���}|r|�|��|j���} |r| �|��t||j ��}!||j |zfid|�d|�d|�d|�d|�d|�d|�d| �d |�d | p|j �d | �d | �d |�d|�d|�d|�d|�d|�d|o|j �d|�d|�d|j �d| �d|�d|!��}"|j�|"��dS)Nr�r�r�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r�r�rrr)r-r�r/r)r��copyrr�rrr(rGrr�r*r�)#r�r�r�r�r�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r�r=rrrr-�combined_responses�current_response_class� current_tags�current_dependencies�current_callbacksr r�s# rW� add_api_routezAPIRouter.add_api_routeqsx��D+�>�d�.>� ��O�� �<���<�)�<��!5� �D�7�" �" ���y�~�~�'�'� � � &� � � �� %� %� %�#�0�5�5�7�7�� � 6� � '� '� � 5� 5� 5� �N�/�/�1�1�� � 0� � $� $�Y� /� /� /�%9� '��)I�& �& �"�� � �K�$� � � � ��X� �*�>� �$� �  � ��  � .�-�  ��G� �$� � �"6�!5� �)�(� �"�4�T�_�� ��G� �&�� �$:�#9� �$:�#9� � %<�$;�! �"*F�)E�# �$-L�,K�% �&)D�(C�' �(0�J�D�4J��) �*2�1�+ �,��- �.+/�*L�*L�/ �0(�'�1 �2(�-�3 �4)C�(B�5 ��8 � ���5�!�!�!�!�!rY�r�r�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r�rrrc����������� � � � � ������������dtdtf��� ���� ��� ���������� � ����fd� }|S)Nr7rLc�d����� |������� ���� �������� ��� ����|S)NrF)rE)r7rr�rGr�rrr�r�rrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s �������������������������rWr:z&APIRouter.api_route.<locals>.decorator�sr��� � � ���-�'��)��'�%9�#�%��)�'=�'=�(?�-I�0O�,G�"3�-��#�+�,G�3 � � � �6�KrYr;)r�r�r�r�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r�rrrr:s````````````````````````` rW� api_routezAPIRouter.api_route�s����������������������������< �-� �2C� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �<�rY)r�c���|j���}|r|�|��t|j|z||||j���}|j�|��dS)N)r�r�r�r�)r�r?rr�r(r�r*r�)r�r�r�r�r�rCr�s rW�add_api_websocket_routez!APIRouter.add_api_websocket_routes��� $�0�5�5�7�7�� � 6� � '� '� � 5� 5� 5�!� �K�$� ���-�*.�*L�  � � �� � ���5�!�!�!�!�!rYz1 WebSocket path. zQ A name for the WebSocket. Only used internally. a A list of dependencies (using `Depends()`) to be used for this WebSocket. Read more about it in the [FastAPI docs for WebSockets](https://fastapi.tiangolo.com/advanced/websockets/). c�<�����dtdtf����fd� }|S)a� Decorate a WebSocket function. Read more about it in the [FastAPI docs for WebSockets](https://fastapi.tiangolo.com/advanced/websockets/). **Example** ## Example ```python from fastapi import APIRouter, FastAPI, WebSocket app = FastAPI() router = APIRouter() @router.websocket("/ws") async def websocket_endpoint(websocket: WebSocket): await websocket.accept() while True: data = await websocket.receive_text() await websocket.send_text(f"Message text was: {data}") app.include_router(router) ``` r7rLc�:�����|�����|S)N)r�r�)rK)r7r�r�r�r�s ����rWr:z&APIRouter.websocket.<locals>.decoratorQs0��� � (� (��d��L� )� � � ��KrYr;)r�r�r�r�r:s```` rWr�zAPIRouter.websocketsL������v �-� �2C� � � � � � � � � � �rYc�8����dtdtf���fd� }|S)Nr7rLc�8�����|����|S)N�r�)�add_websocket_route)r7r�r�r�s ���rWr:z,APIRouter.websocket_route.<locals>.decorator\s#��� � $� $�T�4�d� $� ;� ;� ;��KrYr;)r�r�r�r:s``` rW�websocket_routezAPIRouter.websocket_routeYsE����� �-� �2C� � � � � � � � ��rY) r(r�r�r)r�rrGrr�routerzThe `APIRouter` to include.z� Include (or not) all the *path operations* in this router in the generated OpenAPI schema. This affects the generated OpenAPI (e.g. visible at `/docs`). c ��|r?|�d��s Jd���|�d��r Jd���nB|jD]:} t| d��} t| dd��} | �| st d| �d �����;|�i}|jD�]�}t |t ���r�i|�|j�}t|j |j ||j ��}g}|r|� |��|j r|� |j ��g}|r|� |��|j r|� |j ��g}|r|� |��|jr|� |j��t|j|j| |j��}|�||jz|j|j|j|||j|j|j||jp|p|j|j|j|j|j|j|j|j|j |j!o|j!o| ||j"tG|��||j$|� �����t |tJj&��rItO|jpg��}|�(||jz|j||j!|j"� ����)t |tR��rgg}|r|� |��|j r|� |j ��|�*||jz|j||j"� �����t |tJj+��r*|�,||jz|j|j"� �����|j-D]}|�.d|���|j/D]}|�.d|���ta|j1|j1��|_1dS)a| Include another `APIRouter` in the same current `APIRouter`. Read more about it in the [FastAPI docs for Bigger Applications](https://fastapi.tiangolo.com/tutorial/bigger-applications/). ## Example ```python from fastapi import APIRouter, FastAPI app = FastAPI() internal_router = APIRouter() users_router = APIRouter() @users_router.get("/users/") def read_users(): return [{"name": "Rick"}, {"name": "Morty"}] internal_router.include_router(users_router) app.include_router(internal_router) ``` r2r3r4r�r��unknownNz6Prefix and path cannot be both empty (path operation: �)r<)r�rr�)r�r�rP�startup�shutdown)2r5r�r*r_r&r^r�r�r/r�r)rr�r�rrrEr�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r�rr2�Router`r9r�rK�WebSocketRouterQr.�add_event_handlerr/rq�lifespan_context)r�rSr(r�r�r)r�rrGrr�rr�r�r�r@�use_response_classrBrCrDr r��handlers rW�include_routerzAPIRouter.include_routerbs���N � ��$�$�S�)�)� N� N�+N� N� N�)������� X� X�W� X� X�� X��]� � ���q�&�)�)���q�&�)�4�4���#�D�#�&�X�QU�X�X�X����� � ��I��]�T �T �E��%��*�*�S �%E� �%E�U�_�%E�"�%9��(��1�*��/� &�&�"� "� ��.� �'�'��-�-�-��:�4� �'�'�� �3�3�3�=?�$��>�(�/�/� �=�=�=��%�D�(�/�/��0B�C�C�C�$&�!��8�%�,�,�Y�7�7�7��?�>�%�,�,�U�_�=�=�=�-A��5��6�/��4� .�.�*� �"�"��U�Z�'��N�#(�#7� %� 1�%�!5�!�M� %� 1�).�)C�0�$�/�P�:�P���!�M�!&�!3�+0�+G�+0�+G�,1�,I�16�1S�49�4Y�05�0Q�&+�&=�'*��.�'*�)�#5���)-�e���/�"'�"5�0J�9#�����<�E�7�=�1�1� ��u�}�2��3�3������U�Z�'��N�#�&+�&=��� ������E�#4�5�5� �')�$��>�(�/�/� �=�=�=��%�D�(�/�/��0B�C�C�C��,�,��U�Z�'��N�!5��� -����� �E�7�#9�:�:� ��(�(��U�Z�'���e�j�)������(� 7� 7�G� � "� "�9�g� 6� 6� 6� 6��)� 8� 8�G� � "� "�:�w� 7� 7� 7� 7� 7� � !� � #�! �! ����rY)r�r�r�r�r�r�r�r�rGrr�r�r�r�r�r�rr�r�rrrz� The URL path to be used for this *path operation*. For example, in `http://example.com/items`, the path is `/items`. a� The type to use for the response. It could be any valid Pydantic *field* type. So, it doesn't have to be a Pydantic model, it could be other things, like a `list`, `dict`, etc. It will be used for: * Documentation: the generated OpenAPI (and the UI at `/docs`) will show it as the response (JSON Schema). * Serialization: you could return an arbitrary object and the `response_model` would be used to serialize that object into the corresponding JSON. * Filtering: the JSON sent to the client will only contain the data (fields) defined in the `response_model`. If you returned an object that contains an attribute `password` but the `response_model` does not include that field, the JSON sent to the client would not have that `password`. * Validation: whatever you return will be serialized with the `response_model`, converting any data as necessary to generate the corresponding JSON. But if the data in the object returned is not valid, that would mean a violation of the contract with the client, so it's an error from the API developer. So, FastAPI will raise an error and return a 500 error code (Internal Server Error). Read more about it in the [FastAPI docs for Response Model](https://fastapi.tiangolo.com/tutorial/response-model/). aM The default status code to be used for the response. You could override the status code by returning a response directly. Read more about it in the [FastAPI docs for Response Status Code](https://fastapi.tiangolo.com/tutorial/response-status-code/). ac A list of tags to be applied to the *path operation*. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/#tags). a[ A list of dependencies (using `Depends()`) to be applied to the *path operation*. Read more about it in the [FastAPI docs for Dependencies in path operation decorators](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-in-path-operation-decorators/). aL A summary for the *path operation*. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/). a A description for the *path operation*. If not provided, it will be extracted automatically from the docstring of the *path operation function*. It can contain Markdown. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Path Operation Configuration](https://fastapi.tiangolo.com/tutorial/path-operation-configuration/). z� The description for the default response. It will be added to the generated OpenAPI (e.g. visible at `/docs`). z� Additional responses that could be returned by this *path operation*. It will be added to the generated OpenAPI (e.g. visible at `/docs`). z� Mark this *path operation* as deprecated. It will be added to the generated OpenAPI (e.g. visible at `/docs`). a� Custom operation ID to be used by this *path operation*. By default, it is generated automatically. If you provide a custom operation ID, you need to make sure it is unique for the whole API. You can customize the operation ID generation with the parameter `generate_unique_id_function` in the `FastAPI` class. Read more about it in the [FastAPI docs about how to Generate Clients](https://fastapi.tiangolo.com/advanced/generate-clients/#custom-generate-unique-id-function). a\ Configuration passed to Pydantic to include only certain fields in the response data. Read more about it in the [FastAPI docs for Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/#response_model_include-and-response_model_exclude). aW Configuration passed to Pydantic to exclude certain fields in the response data. Read more about it in the [FastAPI docs for Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/#response_model_include-and-response_model_exclude). a| Configuration passed to Pydantic to define if the response model should be serialized by alias when an alias is used. Read more about it in the [FastAPI docs for Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/#response_model_include-and-response_model_exclude). a� Configuration passed to Pydantic to define if the response data should have all the fields, including the ones that were not set and have their default values. This is different from `response_model_exclude_defaults` in that if the fields are set, they will be included in the response, even if the value is the same as the default. When `True`, default values are omitted from the response. Read more about it in the [FastAPI docs for Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/#use-the-response_model_exclude_unset-parameter). a� Configuration passed to Pydantic to define if the response data should have all the fields, including the ones that have the same value as the default. This is different from `response_model_exclude_unset` in that if the fields are set but contain the same default values, they will be excluded from the response. When `True`, default values are omitted from the response. Read more about it in the [FastAPI docs for Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/#use-the-response_model_exclude_unset-parameter). a~ Configuration passed to Pydantic to define if the response data should exclude fields set to `None`. This is much simpler (less smart) than `response_model_exclude_unset` and `response_model_exclude_defaults`. You probably want to use one of those two instead of this one, as those allow returning `None` values when it makes sense. Read more about it in the [FastAPI docs for Response Model - Return Type](https://fastapi.tiangolo.com/tutorial/response-model/#response_model_exclude_none). a� Include this *path operation* in the generated OpenAPI schema. This affects the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for Query Parameters and String Validations](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#exclude-from-openapi). ae Response class to be used for this *path operation*. This will not be used if you return a response directly. Read more about it in the [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/#redirectresponse). zW Name for this *path operation*. Only used internally. a� List of *path operations* that will be used as OpenAPI callbacks. This is only for OpenAPI documentation, the callbacks won't be used directly. It will be added to the generated OpenAPI (e.g. visible at `/docs`). Read more about it in the [FastAPI docs for OpenAPI Callbacks](https://fastapi.tiangolo.com/advanced/openapi-callbacks/). ah Extra metadata to be included in the OpenAPI schema for this *path operation*. Read more about it in the [FastAPI docs for Path Operation Advanced Configuration](https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/#custom-openapi-path-operation-schema). c�^�|�||||||||| | dg| | | ||||||||||���S)ax Add a *path operation* using an HTTP GET operation. ## Example ```python from fastapi import APIRouter, FastAPI app = FastAPI() router = APIRouter() @router.get("/items/") def read_items(): return [{"name": "Empanada"}, {"name": "Arepa"}] app.include_router(router) ``` r�r�r�r�r�r�r�r�r�r�rGr�rr�r�r�r�r�r�rr�r�rrr�rI�r�r�r�r�r�r�r�r�r�r�rGrr�r�r�r�r�r�rr�r�rrrs rWr�z APIRouter.getVsj��| �~�~��)�#��%��#�!5��!��G�%�#9�#9�$;�)E�,K�(C�/�)���'�(C�1� � � rYc�^�|�||||||||| | dg| | | ||||||||||���S)a% Add a *path operation* using an HTTP PUT operation. ## Example ```python from fastapi import APIRouter, FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI() router = APIRouter() @router.put("/items/{item_id}") def replace_item(item_id: str, item: Item): return {"message": "Item replaced", "id": item_id} app.include_router(router) ``` �PUTrbrcrds rW�putz APIRouter.put�sj��F �~�~��)�#��%��#�!5��!��G�%�#9�#9�$;�)E�,K�(C�/�)���'�(C�1� � � rYc�^�|�||||||||| | dg| | | ||||||||||���S)a� Add a *path operation* using an HTTP POST operation. ## Example ```python from fastapi import APIRouter, FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI() router = APIRouter() @router.post("/items/") def create_item(item: Item): return {"message": "Item created"} app.include_router(router) ``` �POSTrbrcrds rW�postzAPIRouter.postM�j��F �~�~��)�#��%��#�!5��!��H�%�#9�#9�$;�)E�,K�(C�/�)���'�(C�1� � � rYc�^�|�||||||||| | dg| | | ||||||||||���S)a� Add a *path operation* using an HTTP DELETE operation. ## Example ```python from fastapi import APIRouter, FastAPI app = FastAPI() router = APIRouter() @router.delete("/items/{item_id}") def delete_item(item_id: str): return {"message": "Item deleted"} app.include_router(router) ``` �DELETErbrcrds rW�deletezAPIRouter.delete� sj��| �~�~��)�#��%��#�!5��!��J�%�#9�#9�$;�)E�,K�(C�/�)���'�(C�1� � � rYc�^�|�||||||||| | dg| | | ||||||||||���S)a� Add a *path operation* using an HTTP OPTIONS operation. ## Example ```python from fastapi import APIRouter, FastAPI app = FastAPI() router = APIRouter() @router.options("/items/") def get_item_options(): return {"additions": ["Aji", "Guacamole"]} app.include_router(router) ``` �OPTIONSrbrcrds rW�optionszAPIRouter.optionsD sj��| �~�~��)�#��%��#�!5��!��K�%�#9�#9�$;�)E�,K�(C�/�)���'�(C�1� � � rYc�^�|�||||||||| | dg| | | ||||||||||���S)a0 Add a *path operation* using an HTTP HEAD operation. ## Example ```python from fastapi import APIRouter, FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI() router = APIRouter() @router.head("/items/", status_code=204) def get_items_headers(response: Response): response.headers["X-Cat-Dog"] = "Alone in the world" app.include_router(router) ``` �HEADrbrcrds rW�headzAPIRouter.head� rkrYc�^�|�||||||||| | dg| | | ||||||||||���S)a  Add a *path operation* using an HTTP PATCH operation. ## Example ```python from fastapi import APIRouter, FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI() router = APIRouter() @router.patch("/items/") def update_item(item: Item): return {"message": "Item updated in place"} app.include_router(router) ``` �PATCHrbrcrds rW�patchzAPIRouter.patch;�j��F �~�~��)�#��%��#�!5��!��I�%�#9�#9�$;�)E�,K�(C�/�)���'�(C�1� � � rYc�^�|�||||||||| | dg| | | ||||||||||���S)a� Add a *path operation* using an HTTP TRACE operation. ## Example ```python from fastapi import APIRouter, FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None app = FastAPI() router = APIRouter() @router.trace("/items/{item_id}") def trace_item(item_id: str): return None app.include_router(router) ``` �TRACErbrcrds rW�tracezAPIRouter.trace�rxrYz� on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/). � event_typezM The type of event. `startup` or `shutdown`. c�4���dtdtf��fd� }|S)a Add an event handler for the router. `on_event` is deprecated, use `lifespan` event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/#alternative-events-deprecated). r7rLc�4�����|��|Srk)r[)r7r|r�s ��rWr:z%APIRouter.on_event.<locals>.decoratorSs��� � "� "�:�t� 4� 4� 4��KrYr;)r�r|r:s`` rW�on_eventzAPIRouter.on_event7s?����8 �-� �2C� � � � � � � ��rY)NNTrk)3r�r�r�rrr6r�r.rErprFrr rrrrr�rr7r rrr8rGr%r@r rAr�r*r�rr+rrErIrKr�rRr`r�rgrjrnrqrtrwr{rr�r�s@rWr'r'Ss�9���������:RT� � � �G�L� !� !� � �, � � � � � � � � � � �G�&� '� '�knG�nG�nG��#�s�s�#L�M�M�M�N�nG�� �T�%��T� �*�+� ,� �C�� � � �  � nG�$ � �X�f�n�-� .� �C�� � � �  �%nG�<!*� ��N� �C�� � � � ! �=nG�R� �T�%��S��/�4��S��>�9�:� ;� �C� � � � � �SnG�r� �T�)�_� %� �C�� � � �  �snG�N� �T�)�_� %� �C�� � � �J�� � � � �OnG�z$� � �C�� � � � �{nG�L� �W� � �C�� � � � �MnG�^(1� �S�M� �C�� � � � ( �_nG�t� ��N� �C�� � � �  �unG�J� �X�h�r�3�w�/�0� 1� �C�� � � �  �KnG�b� �X�h�r�3�w�/�0� 1� �C�� � � �  �cnG�@� �X�c�]� #� �C�� � � �  �AnG�X� �T�N� �C�� � � �  �YnG�r%� � �C�� � � �  �snG�N&/� �h�Z��_� %� �C� � � � �& �OnG�l �mnG�nG�nG�nG�nG�nG�f(,�"�"&� �����$�s�)�$���s�m� �  � � �$�%�'8�8� 9� ����0&�g�d�m�m�%)�15�;?�!%�%)�$9�EI�%)�8<�&*�26�26�(,�-2�05�,1�"&�DK�G� �E �E �#�9=�/3�26� �G�&� '� '�AP"�P"�P"��P"��3��8�$�P"� � P"� �c�]� P"��t�E�#�t�)�,�-�.�P"��x���7�8�P"��#��P"��c�]�P"�"�P"��D��s�C�x��$�s�C�x�.�!@�A�B�P"��T�N�P"��%��C��$�s�)� 3�4�5�P"��s�m�P"� !)���!P"�"!)���#P"�$"&�%P"�&'+�'P"�(*.�)P"�*&*�+P"�, �-P"�.�d�8�n�.@�@�A�/P"�4�s�m�5P"�6'�t�H�~�6�7P"�8�D��O�,�9P"�: ��S�#�X��/�;P"�<&+� �h�Z��_� %�'9� 9�& �=P"�B �CP"�P"�P"�P"�l&�g�d�m�m�%)�15�;?�!%�%)�$9�EI�%)�'+�&*�26�26�(,�-2�05�,1�"&�)0���)>�)>�"�/3�26�AH�� �B �B �5<�<�<��<�� <� �c�]� <� �t�E�#�t�)�,�-�.� <��x���7�8�<��#��<��c�]�<�"�<��D��s�C�x��$�s�C�x�.�!@�A�B�<��T�N�<��$�s�)�$�<��s�m�<�!)���<� !)���!<�""&�#<�$'+�%<�&*.�'<�(&*�)<�* �+<�,�X��-<�.�s�m�/<�0�D��O�,�1<�2 ��S�#�X��/�3<�4&.�x�j�#�o�%>�5<�: �$�%�'8�8� 9�;<�<�<�<�D#� "� <@� "�"�"��"��3��8�$�"��s�m� "� �x���7�8� "� �"�"�"�"�L �#A�< �=A�A�A�� � �C�� � � � �A�� �S�M� �C�� � � � �A�& � �X�f�n�-� .� �C�� � � �  �'A�> �$�%�'8�8� 9�?A�A�A�A�H37�����$�S�$�Y�/�� �$�%�'8�8� 9�����RT� � � �G�L� !� !� � � � � �G�&� '� '�]r �r �r ��+�s�s�+H�'I�'I�I�J�r ��#�s�s�#L�M�M�M�N� r � � �T�%��T� �*�+� ,� �C�� � � �  � r �& � �X�f�n�-� .� �C�� � � �  �'r �>!*� ��N� �C�� � � � ! �?r �T� �T�%��S��/�4��S��>�9�:� ;� �C� � � � � �Ur �t� �T�)�_� %� �C�� � � �  �ur �P� �T�N� �C�� � � �  �Qr �j%� � �C�� � � �  �kr �@&/� �h�Z��_� %� �C� � � � �& �Ar �^ �_r �r �r �r �D �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U w �w �w �� � �C�� � � �  �w �"� � �C�� � � �! �w �^� �S�M� �C�� � � �  �_w �x� �T�%��T� �*�+� ,� �C�� � � �  �yw �R � �X�f�n�-� .� �C�� � � �  �Sw �j� �S�M� �C�� � � �  �kw �D� �S�M� �C� � � � � �Ew �h(� � �C�� � � �  �iw �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}w �P� �T�N� �C�� � � �  �Qw �d � �S�M� �C�� � � � �ew �L!*� �U�O� �C�� � � � ! �Mw �d!*� �U�O� �C�� � � � ! �ew �|"+� � �C�� � � � " �}w �T'0� � �C� � � � �' �Uw �x*3� � �C� � � � �* �yw �Z&/� � �C� � � � �& �[w �|%� � �C�� � � �  �}w �V"� ��N� �C�� � � �  �Ww �p� �S�M� �C�� � � � �qw �@ � �T�)�_� %� �C� � � � � �A w �` !� �T�#�s�(�^� $� �C�� � � �  �a w �x &/� �h�Z��_� %� �C� � � � �& �y w �V �$�%�'8�8� 9�W w �w �w �w �N �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U | �| �| �� � �C�� � � �  �| �"� � �C�� � � �! �| �^� �S�M� �C�� � � �  �_| �x� �T�%��T� �*�+� ,� �C�� � � �  �y| �R � �X�f�n�-� .� �C�� � � �  �S| �j� �S�M� �C�� � � �  �k| �D� �S�M� �C� � � � � �E| �h(� � �C�� � � �  �i| �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}| �P� �T�N� �C�� � � �  �Q| �d � �S�M� �C�� � � � �e| �L!*� �U�O� �C�� � � � ! �M| �d!*� �U�O� �C�� � � � ! �e| �|"+� � �C�� � � � " �}| �T'0� � �C� � � � �' �U| �x*3� � �C� � � � �* �y| �Z&/� � �C� � � � �& �[| �|%� � �C�� � � �  �}| �V"� ��N� �C�� � � �  �W| �p� �S�M� �C�� � � � �q| �@ � �T�)�_� %� �C� � � � � �A | �` !� �T�#�s�(�^� $� �C�� � � �  �a | �x &/� �h�Z��_� %� �C� � � � �& �y | �V �$�%�'8�8� 9�W | �| �| �| �X �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U | �| �| �� � �C�� � � �  �| �"� � �C�� � � �! �| �^� �S�M� �C�� � � �  �_| �x� �T�%��T� �*�+� ,� �C�� � � �  �y| �R � �X�f�n�-� .� �C�� � � �  �S| �j� �S�M� �C�� � � �  �k| �D� �S�M� �C� � � � � �E| �h(� � �C�� � � �  �i| �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}| �P� �T�N� �C�� � � �  �Q| �d � �S�M� �C�� � � � �e| �L!*� �U�O� �C�� � � � ! �M| �d!*� �U�O� �C�� � � � ! �e| �|"+� � �C�� � � � " �}| �T'0� � �C� � � � �' �U| �x*3� � �C� � � � �* �y| �Z&/� � �C� � � � �& �[| �|%� � �C�� � � �  �}| �V"� ��N� �C�� � � �  �W| �p� �S�M� �C�� � � � �q| �@ � �T�)�_� %� �C� � � � � �A | �` !� �T�#�s�(�^� $� �C�� � � �  �a | �x &/� �h�Z��_� %� �C� � � � �& �y | �V �$�%�'8�8� 9�W | �| �| �| �X �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U w �w �w �� � �C�� � � �  �w �"� � �C�� � � �! �w �^� �S�M� �C�� � � �  �_w �x� �T�%��T� �*�+� ,� �C�� � � �  �yw �R � �X�f�n�-� .� �C�� � � �  �Sw �j� �S�M� �C�� � � �  �kw �D� �S�M� �C� � � � � �Ew �h(� � �C�� � � �  �iw �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}w �P� �T�N� �C�� � � �  �Qw �d � �S�M� �C�� � � � �ew �L!*� �U�O� �C�� � � � ! �Mw �d!*� �U�O� �C�� � � � ! �ew �|"+� � �C�� � � � " �}w �T'0� � �C� � � � �' �Uw �x*3� � �C� � � � �* �yw �Z&/� � �C� � � � �& �[w �|%� � �C�� � � �  �}w �V"� ��N� �C�� � � �  �Ww �p� �S�M� �C�� � � � �qw �@ � �T�)�_� %� �C� � � � � �A w �` !� �T�#�s�(�^� $� �C�� � � �  �a w �x &/� �h�Z��_� %� �C� � � � �& �y w �V �$�%�'8�8� 9�W w �w �w �w �N �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U w �w �w �� � �C�� � � �  �w �"� � �C�� � � �! �w �^� �S�M� �C�� � � �  �_w �x� �T�%��T� �*�+� ,� �C�� � � �  �yw �R � �X�f�n�-� .� �C�� � � �  �Sw �j� �S�M� �C�� � � �  �kw �D� �S�M� �C� � � � � �Ew �h(� � �C�� � � �  �iw �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}w �P� �T�N� �C�� � � �  �Qw �d � �S�M� �C�� � � � �ew �L!*� �U�O� �C�� � � � ! �Mw �d!*� �U�O� �C�� � � � ! �ew �|"+� � �C�� � � � " �}w �T'0� � �C� � � � �' �Uw �x*3� � �C� � � � �* �yw �Z&/� � �C� � � � �& �[w �|%� � �C�� � � �  �}w �V"� ��N� �C�� � � �  �Ww �p� �S�M� �C�� � � � �qw �@ � �T�)�_� %� �C� � � � � �A w �` !� �T�#�s�(�^� $� �C�� � � �  �a w �x &/� �h�Z��_� %� �C� � � � �& �y w �V �$�%�'8�8� 9�W w �w �w �w �N �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U | �| �| �� � �C�� � � �  �| �"� � �C�� � � �! �| �^� �S�M� �C�� � � �  �_| �x� �T�%��T� �*�+� ,� �C�� � � �  �y| �R � �X�f�n�-� .� �C�� � � �  �S| �j� �S�M� �C�� � � �  �k| �D� �S�M� �C� � � � � �E| �h(� � �C�� � � �  �i| �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}| �P� �T�N� �C�� � � �  �Q| �d � �S�M� �C�� � � � �e| �L!*� �U�O� �C�� � � � ! �M| �d!*� �U�O� �C�� � � � ! �e| �|"+� � �C�� � � � " �}| �T'0� � �C� � � � �' �U| �x*3� � �C� � � � �* �y| �Z&/� � �C� � � � �& �[| �|%� � �C�� � � �  �}| �V"� ��N� �C�� � � �  �W| �p� �S�M� �C�� � � � �q| �@ � �T�)�_� %� �C� � � � � �A | �` !� �T�#�s�(�^� $� �C�� � � �  �a | �x &/� �h�Z��_� %� �C� � � � �& �y | �V �$�%�'8�8� 9�W | �| �| �| �X �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U | �| �| �� � �C�� � � �  �| �"� � �C�� � � �! �| �^� �S�M� �C�� � � �  �_| �x� �T�%��T� �*�+� ,� �C�� � � �  �y| �R � �X�f�n�-� .� �C�� � � �  �S| �j� �S�M� �C�� � � �  �k| �D� �S�M� �C� � � � � �E| �h(� � �C�� � � �  �i| �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}| �P� �T�N� �C�� � � �  �Q| �d � �S�M� �C�� � � � �e| �L!*� �U�O� �C�� � � � ! �M| �d!*� �U�O� �C�� � � � ! �e| �|"+� � �C�� � � � " �}| �T'0� � �C� � � � �' �U| �x*3� � �C� � � � �* �y| �Z&/� � �C� � � � �& �[| �|%� � �C�� � � �  �}| �V"� ��N� �C�� � � �  �W| �p� �S�M� �C�� � � � �q| �@ � �T�)�_� %� �C� � � � � �A | �` !� �T�#�s�(�^� $� �C�� � � �  �a | �x &/� �h�Z��_� %� �C� � � � �& �y | �V �$�%�'8�8� 9�W | �| �| �| �X �G�D�M�M� � � � �$ � "� � �( � � � �$ �" �" � � �G�L� !� !� � � � �G�&� '� '�U | �| �| �� � �C�� � � �  �| �"� � �C�� � � �! �| �^� �S�M� �C�� � � �  �_| �x� �T�%��T� �*�+� ,� �C�� � � �  �y| �R � �X�f�n�-� .� �C�� � � �  �S| �j� �S�M� �C�� � � �  �k| �D� �S�M� �C� � � � � �E| �h(� � �C�� � � �  �i| �|� �T�%��S��/�4��S��>�9�:� ;� �C�� � � �  �}| �P� �T�N� �C�� � � �  �Q| �d � �S�M� �C�� � � � �e| �L!*� �U�O� �C�� � � � ! �M| �d!*� �U�O� �C�� � � � ! �e| �|"+� � �C�� � � � " �}| �T'0� � �C� � � � �' �U| �x*3� � �C� � � � �* �y| �Z&/� � �C� � � � �& �[| �|%� � �C�� � � �  �}| �V"� ��N� �C�� � � �  �W| �p� �S�M� �C�� � � � �q| �@ � �T�)�_� %� �C� � � � � �A | �` !� �T�#�s�(�^� $� �C�� � � �  �a | �x &/� �h�Z��_� %� �C� � � � �& �y | �V �$�%�'8�8� 9�W | �| �| �| �| �Z� ����� � �C�� � � � �� �$�%�'8�8� 9����������rYr')NF)or�rc� email.messager�rr�� contextlibrr�enumrr�typingrrr r r r r rrrrrr�fastapir�fastapi._compatrrrrrr�fastapi.datastructuresrr�fastapi.dependencies.modelsr�fastapi.dependencies.utilsrrr r!r"r#r$�fastapi.encodersr%�fastapi.exceptionsr&r'r(r)� fastapi.typesr*r+� fastapi.utilsr,r-r.r/r0�pydanticr1� starletter2�starlette.concurrencyr3�starlette.exceptionsr4�starlette.requestsr5�starlette.responsesr6r7�starlette.routingr8r9r:r;r<r=r>�starlette.typesr?r@rArB�starlette.websocketsrD�typing_extensionsrErFrGr%rTrqr�rpr�rr�r�rZr�rYr��Routerr'rlrYrW�<module>r�sh������������������ � � � �:�:�:�:�:�:�:�:��������������������������������������� ����������������������?�>�>�>�>�>�>�>�1�1�1�1�1�1�������������������.�-�-�-�-�-������������� 3�2�2�2�2�2�2�2���������������������������3�3�3�3�3�3�.�.�.�.�.�.�&�&�&�&�&�&�6�6�6�6�6�6�6�6�����������������-�,�,�,�,�,�=�=�=�=�=�=�=�=�=�=�=�=�*�*�*�*�*�*�8�8�8�8�8�8�8�8�8�8�#�� ,�,�,� �,��,�� ,� � ,�  � ,�,�,�,�^��s�m��5=�c�]�� �c�]�����&#'�#�#���"���:2�:2�:2� �J� �:2��:2��e�_� :2� �e�_� :2� � :2��:2��:2��:2��:2� �:2�:2�:2�:2�z A�� A�%)�#�s�(�^� A�CG� A�� A� A� A� A�(,�!%�@G�� �@U�@U�+/�.2�.2�$(�).�,1�(-�37�#�L�L��L���$�L��#��L��$�x�.�*<�<�=� L� �Z�(� L� %�U�O� L�%�U�O�L�"�L�#'�L�&*�L�"&�L�$,�C�=�L��L��w�i��3��X�#5�6�6�7�L�L�L�L�b48�#�����#+�C�=�����y�k�9�S�#�s�]�3�3�4� ����8%"�%"�%"�%"�%"��.�%"�%"�%"�Pd"�d"�d"�d"�d"�w�}�d"�d"�d"�ND<�D<�D<�D<�D<���D<�D<�D<�D<�D<rY
Memory