§
    ¦”jÑ  ã                   óF  — d dl mZ d dlmZmZmZmZ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 eeef         Z G d„ ded         ¦  «        Z G d	„ d
ed
         ¦  «        Z G d„ ded         ¦  «        Z G d„ ded         ¦  «        Z G d„ ded         ¦  «        ZdS )é    )Úabstractmethod)ÚTYPE_CHECKINGÚAnyÚDictÚListÚOptionalÚTypeÚUnion)ÚOpenApiGeneratorExtension)Ú	Direction)ÚAPIView)Ú
AutoSchemac            
       ó   — e Zd ZU dZg Zeed                   ed<   ee	ee	         f         ed<   dddee
e	ee         f         ee
e	ee         f                  f         fd„Zedddeeee         f         fd„¦   «         Zd	S )
ÚOpenApiAuthenticationExtensionaC  
    Extension for specifying authentication schemes.

    The common use-case usually consists of setting a ``name`` string and returning a dict from
    ``get_security_definition``. To model a group of headers that go together, set a list
    of names and return a corresponding list of definitions from ``get_security_definition``.

    The view class is available via ``auto_schema.view``, while the original authentication class
    can be accessed via ``self.target``. If you want to override an included extension, be sure to
    set a higher matching priority by setting the class attribute ``priority = 1`` or higher.

    get_security_requirement is expected to return a dict with security object names as keys and a
    scope list as value (usually just []). More than one key in the dict means that each entry is
    required (AND). If you need alternate variations (OR), return a list of those dicts instead.

    ``get_security_definition()`` is expected to return a valid `OpenAPI security scheme object
    <https://spec.openapis.org/oas/v3.0.3#security-scheme-object>`_
    Ú	_registryÚnameÚauto_schemar   Úreturnc                 óŒ   — | j         s
J d¦   «         ‚t          | j         t          ¦  «        r	| j         g iS d„ | j         D ¦   «         S )Nzname(s) must be specifiedc                 ó   — i | ]}|g “ŒS © r   )Ú.0r   s     úi/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/drf_spectacular/extensions.pyú
<dictcomp>zKOpenApiAuthenticationExtension.get_security_requirement.<locals>.<dictcomp>.   s   € Ð3Ð3Ð3 �D˜"Ð3Ð3Ð3ó    )r   Ú
isinstanceÚstr©Úselfr   s     r   Úget_security_requirementz7OpenApiAuthenticationExtension.get_security_requirement'   sQ   € ð ŒyÐ5Ð5Ð5Ñ5Ô5Ð5Ý�d”i¥Ñ%Ô%ð 	4Ø”I˜r�?Ð"à3Ð3¨¬Ð3Ñ3Ô3Ð3r   c                 ó   — d S ©Nr   r   s     r   Úget_security_definitionz6OpenApiAuthenticationExtension.get_security_definition0   ó   € àˆr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r	   Ú__annotations__r
   r   r   r   r    r   Ú_SchemaTyper#   r   r   r   r   r      sã   € € € € € € ðð ð$ ?A€Iˆt�DÐ9Ô:Ô;Ð@Ð@Ñ@à
��T˜#”Y�Ô
ÐÐÑð4Ø+ð4à	ˆt�C˜˜cœ�NÔ# T¨$¨s°D¸´I¨~Ô*>Ô%?Ð?Ô	@ð4ð 4ð 4ð 4ð ð°<ð ÀEÈ+ÐW[Ð\gÔWhÐJhÔDið ð ð ñ „^ðð ð r   r   c                   ó‚   — e Zd ZU dZg Zeed                   ed<   dddede	e
         fd„Zdddedefd„Zdddedefd	„Zd
S )ÚOpenApiSerializerExtensiona  
    Extension for replacing an insufficient or specifying an unknown Serializer schema.

    The existing implementation of ``map_serializer()`` will generate the same result
    as *drf-spectacular* would. Either augment or replace the generated schema. The
    view instance is available via ``auto_schema.view``, while the original serializer
    can be accessed via ``self.target``.

    ``map_serializer()`` is expected to return a valid `OpenAPI schema object
    <https://spec.openapis.org/oas/v3.0.3#schema-object>`_.
    r   r   r   Ú	directionr   c                 ó   — dS )z3 return str for overriding default name extraction Nr   ©r   r   r-   s      r   Úget_namez#OpenApiSerializerExtension.get_nameC   ó   € àˆtr   c                 ó   — dS )zQ return anything to compare instances of target. Target will be used by default. Nr   r/   s      r   Úget_identityz'OpenApiSerializerExtension.get_identityG   r1   r   c                 ó<   — |                      | j        |d¬¦  «        S )z, override for customized serializer mapping T)Úbypass_extensions)Ú_map_serializerÚtarget_classr/   s      r   Úmap_serializerz)OpenApiSerializerExtension.map_serializerK   s!   € à×*Ò*¨4Ô+<¸iÐ[_Ð*Ñ`Ô`Ð`r   N)r%   r&   r'   r(   r   r   r	   r)   r   r   r   r0   r   r3   r*   r8   r   r   r   r,   r,   5   sÇ   € € € € € € ð
ð 
ð ;=€Iˆt�DÐ5Ô6Ô7Ð<Ð<Ñ<ð Lð ¸Yð È8ÐTWÌ=ð ð ð ð ð¨ð Àð Èsð ð ð ð ða¨,ð aÀ9ð aÐQ\ð að að að að að ar   r,   c                   óv   — e Zd ZU dZg Zeed                   ed<   dee	         fd„Z
edddedefd„¦   «         Zd	S )
ÚOpenApiSerializerFieldExtensiona<  
    Extension for replacing an insufficient or specifying an unknown SerializerField schema.

    To augment the default schema, you can get what *drf-spectacular* would generate with
    ``auto_schema._map_serializer_field(self.target, direction, bypass_extensions=True)``.
    and edit the returned schema at your discretion. Beware that this may still emit
    warnings, in which case manual construction is advisable.

    ``map_serializer_field()`` is expected to return a valid `OpenAPI schema object
    <https://spec.openapis.org/oas/v3.0.3#schema-object>`_.
    r   r   c                 ó   — dS )zH return str for breaking out field schema into separate named component Nr   ©r   s    r   r0   z(OpenApiSerializerFieldExtension.get_name^   r1   r   r   r   r-   c                 ó   — dS )z2 override for customized serializer field mapping Nr   r/   s      r   Úmap_serializer_fieldz4OpenApiSerializerFieldExtension.map_serializer_fieldb   s	   € ð 	ˆr   N)r%   r&   r'   r(   r   r   r	   r)   r   r   r0   r   r   r*   r>   r   r   r   r:   r:   P   s”   € € € € € € ð
ð 
ð @B€Iˆt�DÐ:Ô;Ô<ÐAÐAÑAð˜( 3œ-ð ð ð ð ð ð°ð Èð ÐWbð ð ð ñ „^ðð ð r   r:   c                   ó”   ‡ — e Zd ZU dZg Zeed                   ed<   ˆ fd„Ze	ˆ fd„¦   «         Z
e	d
d„¦   «         Zedd	„¦   «         Zˆ xZS )ÚOpenApiViewExtensiona¦  
    Extension for replacing discovered views with a more schema-appropriate/annotated version.

    ``view_replacement()`` is expected to return a subclass of ``APIView`` (which includes
    ``ViewSet`` et al.). The discovered original view callback can be accessed with
    ``self.target_callback``, while the discovered original view class can be accessed
    with ``self.target`` and can be subclassed if desired.
    r   c                 ób   •— t          ¦   «                              |j        ¦  «         || _        d S r"   )ÚsuperÚ__init__ÚclsÚtarget_callback)r   rE   Ú	__class__s     €r   rC   zOpenApiViewExtension.__init__s   s,   ø€ Ý‰Œ×Ò˜Ô,Ñ-Ô-Ð-Ø.ˆÔÐÐr   c                 ó˜   •— t          ¦   «                              ¦   «          t          | j        d¦  «        r| j        j        | _        d S d S )NrD   )rB   Ú_load_classÚhasattrr7   rD   )rD   rF   s    €r   rH   z OpenApiViewExtension._load_classw   sL   ø€ å‰Œ×ÒÑÔÐå�3Ô# UÑ+Ô+ð 	4Ø"Ô/Ô3ˆCÔÐÐð	4ð 	4r   r   úOptional[OpenApiViewExtension]c                 óŠ   — t          | j        d„ d¬¦  «        D ])}|                     |j        ¦  «        r ||¦  «        c S Œ*d S )Nc                 ó   — | j         S r"   )Úpriority)Úes    r   ú<lambda>z0OpenApiViewExtension.get_match.<locals>.<lambda>€   s   € ¸Q¼Z€ r   T)ÚkeyÚreverse)Úsortedr   Ú_matchesrD   )rD   rE   Ú	extensions      r   Ú	get_matchzOpenApiViewExtension.get_match~   s`   € å ¤Ð3GÐ3GÐQUÐVÑVÔVð 	2ð 	2ˆIØ×!Ò! /Ô"5Ñ6Ô6ð 2Ø �y Ñ1Ô1Ð1Ð1Ð1ð2àˆtr   úType[APIView]c                 ó   — d S r"   r   r<   s    r   Úview_replacementz%OpenApiViewExtension.view_replacement…   r$   r   )r   rJ   )r   rV   )r%   r&   r'   r(   r   r   r	   r)   rC   ÚclassmethodrH   rU   r   rX   Ú__classcell__)rF   s   @r   r@   r@   h   sÆ   ø€ € € € € € ðð ð 57€Iˆt�DÐ/Ô0Ô1Ð6Ð6Ñ6ð/ð /ð /ð /ð /ð ð4ð 4ð 4ð 4ñ „[ð4ð ðð ð ñ „[ðð ðð ð ñ „^ðð ð ð ð r   r@   c                   óf   — e Zd ZU dZg Zeed                   ed<   edddee	         fd„¦   «         Z
dS )ÚOpenApiFilterExtensiona.  
    Extension for specifying a list of filter parameters for a given ``FilterBackend``.

    The original filter class object can be accessed via ``self.target``. The attached view
    is accessible via ``auto_schema.view``.

    ``get_schema_operation_parameters()`` is expected to return either an empty list or a list
    of valid raw `OpenAPI parameter objects
    <https://spec.openapis.org/oas/v3.0.3#parameter-object>`_.
    Using ``drf_spectacular.plumbing.build_parameter_type`` is recommended to generate
    the appropriate raw dict objects.
    r   r   r   r   c                 ó   — d S r"   r   )r   r   ÚargsÚkwargss       r   Úget_schema_operation_parametersz6OpenApiFilterExtension.get_schema_operation_parameters™   r$   r   N)r%   r&   r'   r(   r   r   r	   r)   r   r*   r`   r   r   r   r\   r\   Š   sp   € € € € € € ðð ð 79€Iˆt�DÐ1Ô2Ô3Ð8Ð8Ñ8àð¸<ð Ð]aÐbmÔ]nð ð ð ñ „^ðð ð r   r\   N)Úabcr   Útypingr   r   r   r   r   r	   r
   Údrf_spectacular.plumbingr   Údrf_spectacular.utilsr   Úrest_framework.viewsr   Údrf_spectacular.openapir   r   r*   r   r,   r:   r@   r\   r   r   r   ú<module>rg      sµ  ðØ Ð Ð Ð Ð Ð Ø HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ Hà >Ð >Ð >Ð >Ð >Ð >Ø +Ð +Ð +Ð +Ð +Ð +àð 3Ø,Ð,Ð,Ð,Ð,Ð,à2Ð2Ð2Ð2Ð2Ð2ð �3˜�8Œn€ð"ð "ð "ð "ð "Ð%>Ð?_Ô%`ñ "ô "ð "ðJað að að að aÐ!:Ð;WÔ!Xñ aô að að6ð ð ð ð Ð&?Ð@aÔ&bñ ô ð ð0ð ð ð ð Ð4Ð5KÔLñ ô ð ðDð ð ð ð Ð6Ð7OÔPñ ô ð ð ð r   