Ë
    ¢S9iÑ  ã                   ó  — 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y)é    )Ú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y	)
Ú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 | j                   D �ci c]  }|g “Œ c}S c c}w )Nzname(s) must be specified)r   Ú
isinstanceÚstr)Úselfr   r   s      úm/home/cursorai/projects/telegram-earn/backend/venv/lib/python3.12/site-packages/drf_spectacular/extensions.pyÚget_security_requirementz7OpenApiAuthenticationExtension.get_security_requirement'   sR   € ð �yŠyÐ5Ð5Ó5ˆyÜ�d—i‘i¤Ô%Ø—I‘I˜r�?Ð"à)-¯ªÓ3© �D˜"‘H¨Ñ3Ð3ùÒ3s   Á

Ac                  ó   — y ©N© )r   r   s     r   Úget_security_definitionz6OpenApiAuthenticationExtension.get_security_definition0   ó   € àó    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ð ð°<ð ÀEÈ+ÐW[Ð\gÑWhÐJhÑDiò ó ñr    r   c                   ón   — 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y
)Ú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                  ó   — y)z3 return str for overriding default name extraction Nr   ©r   r   r)   s      r   Úget_namez#OpenApiSerializerExtension.get_nameC   ó   € àr    c                  ó   — y)zQ return anything to compare instances of target. Target will be used by default. Nr   r+   s      r   Úget_identityz'OpenApiSerializerExtension.get_identityG   r-   r    c                 ó>   — |j                  | 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   r,   r   r/   r&   r4   r   r    r   r(   r(   5   sv   … ñ
ð ;=€Iˆt�DÐ5Ñ6Ñ7Ó<ð Lð ¸Yð È8ÐTWÉ=ó ð¨ð Àð Èsó ða¨,ð aÀ9ð aÐQ\ô ar    r(   c                   ó\   — 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y	)
Ú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                  ó   — y)zH return str for breaking out field schema into separate named component Nr   ©r   s    r   r,   z(OpenApiSerializerFieldExtension.get_name^   r-   r    r   r   r)   c                  ó   — y)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   r,   r   r   r&   r:   r   r    r   r6   r6   P   sZ   … ñ
ð @B€Iˆt�DÐ:Ñ;Ñ<ÓAð˜( 3™-ó ð ð°ð Èð ÐWbò ó ñr    r6   c                   óv   ‡ — 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                 óF   •— t         ‰| �  |j                  «       || _        y r   )ÚsuperÚ__init__ÚclsÚtarget_callback)r   rA   Ú	__class__s     €r   r?   zOpenApiViewExtension.__init__s   s   ø€ Ü‰Ñ˜×,Ñ,Ô-Ø.ˆÕr    c                 ó†   •— t         ‰| �  «        t        | j                  d«      r| j                  j                  | _        y y )Nr@   )r>   Ú_load_classÚhasattrr3   r@   )r@   rB   s    €r   rD   z OpenApiViewExtension._load_classw   s7   ø€ ä‰ÑÔä�3×#Ñ# UÔ+Ø"×/Ñ/×3Ñ3ˆCÕð ,r    c                 óŠ   — t        | j                  d„ d¬«      D ]'  }|j                  |j                  «      sŒ ||«      c S  y )Nc                 ó   — | j                   S r   )Úpriority)Úes    r   Ú<lambda>z0OpenApiViewExtension.get_match.<locals>.<lambda>€   s   € ¸Q¿ZºZr    T)ÚkeyÚreverse)Úsortedr   Ú_matchesr@   )r@   rA   Ú	extensions      r   Ú	get_matchzOpenApiViewExtension.get_match~   s@   € ä §¡Ñ3GÐQU×VˆIØ×!Ñ! /×"5Ñ"5Õ6Ù  Ó1Ò1ð Wð r    c                  ó   — y r   r   r8   s    r   Úview_replacementz%OpenApiViewExtension.view_replacement…   r   r    )r   zOptional[OpenApiViewExtension])r   zType[APIView])r!   r"   r#   r$   r   r   r	   r%   r?   ÚclassmethodrD   rP   r   rR   Ú__classcell__)rB   s   @r   r<   r<   h   s`   ø… ñð 57€Iˆt�DÐ/Ñ0Ñ1Ó6ô/ð ó4ó ð4ð òó ðð òó ôr    r<   c                   óL   — e Zd ZU dZg Zeed       ed<   edddee	   fd„«       Z
y)Ú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                  ó   — y 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&   rZ   r   r    r   rV   rV   Š   sE   … ñð 79€Iˆt�DÐ1Ñ2Ñ3Ó8àð¸<ð Ð]aÐbmÑ]nò ó ñr    rV   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(   r6   r<   rV   r   r    r   Ú<module>ra      s’   ðÝ ß H× HÑ Hå >Ý +áÝ,å2ð �3˜�8‰n€ô"Ð%>Ð?_Ñ%`ô "ôJaÐ!:Ð;WÑ!Xô aô6Ð&?Ð@aÑ&bô ô0Ð4Ð5KÑLô ôDÐ6Ð7OÑPõ r    