
    @|h                    H    d Z ddlmZ ddlZddlmZ ddlmZ  G d d      Zy)	zBase class for Plugin classes.    )annotationsN   )APISpecPluginMethodNotImplementedErrorc                      e Zd ZdZd
dZ	 	 	 	 	 	 	 	 ddZddZddZddZ	 	 	 d	 	 	 	 	 	 	 	 	 ddZ		 	 d	 	 	 	 	 	 	 dd	Z
y)
BasePluginz&Base class for APISpec plugin classes.c                     y)zInitialize plugin with APISpec object

        :param APISpec spec: APISpec object this plugin instance is attached to
        N )selfspecs     M/var/www/html/test/engine/venv/lib/python3.12/site-packages/apispec/plugin.py	init_speczBasePlugin.init_spec   s        c                    t         )zMay return definition as a dict.

        :param str name: Identifier by which schema may be referenced
        :param dict definition: Schema definition
        :param kwargs: All additional keywords arguments sent to `APISpec.schema()`
        r   )r   name
definitionkwargss       r   schema_helperzBasePlugin.schema_helper   s
     .-r   c                    t         )zMay return response component description as a dict.

        :param dict response: Response fields
        :param kwargs: All additional keywords arguments sent to `APISpec.response()`
        r   )r   responser   s      r   response_helperzBasePlugin.response_helper   
     .-r   c                    t         )zMay return parameter component description as a dict.

        :param dict parameter: Parameter fields
        :param kwargs: All additional keywords arguments sent to `APISpec.parameter()`
        r   )r   	parameterr   s      r   parameter_helperzBasePlugin.parameter_helper'   r   r   c                    t         )zMay return header component description as a dict.

        :param dict header: Header fields
        :param kwargs: All additional keywords arguments sent to `APISpec.header()`
        r   )r   headerr   s      r   header_helperzBasePlugin.header_helper/   r   r   Nc                    t         )a  May return a path as string and mutate operations dict and parameters list.

        :param str path: Path to the resource
        :param dict operations: A `dict` mapping HTTP methods to operation object. See
            https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject
        :param list parameters: A `list` of parameters objects or references for the path. See
            https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameterObject
            and https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#referenceObject
        :param kwargs: All additional keywords arguments sent to `APISpec.path()`

        Return value should be a string or None. If a string is returned, it
        is set as the path.

        The last path helper returning a string sets the path value. Therefore,
        the order of plugin registration matters. However, generally, registering
        several plugins that return a path does not make sense.
        r   )r   path
operations
parametersr   s        r   path_helperzBasePlugin.path_helper7   s
    0 .-r   c                    t         )a^  May mutate operations.

        :param str path: Path to the resource
        :param dict operations: A `dict` mapping HTTP methods to operation object.
            See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject
        :param kwargs: All additional keywords arguments sent to `APISpec.path()`
        r   )r   r!   r"   r   s       r   operation_helperzBasePlugin.operation_helperQ   s
     .-r   )r   r   returnNone)r   strr   dictr   
typing.Anyr'   dict | None)r   r*   r   r+   r'   r,   )r   r*   r   r+   r'   r,   )r   r*   r   r+   r'   r,   )NNN)
r!   
str | Noner"   r,   r#   zlist[dict] | Noner   r+   r'   r-   )NN)r!   r-   r"   r,   r   r+   r'   r(   )__name__
__module____qualname____doc__r   r   r   r   r   r$   r&   r   r   r   r	   r	      s    0	.	.%)	.5?	.		....  "&(,	..  . &	.
 . 
.8  "&..  . 	.
 
.r   r	   )	r1   
__future__r   typingcorer   
exceptionsr   r	   r   r   r   <module>r6      s     $ "   7S. S.r   