o
    FD©iœ  ã                   @  sB   d Z ddlmZ ddlZddlmZ ddlmZ G dd„ dƒZdS )	zBase class for Plugin classes.é    )ÚannotationsNé   )ÚAPISpec©ÚPluginMethodNotImplementedErrorc                   @  sd   e Zd ZdZd$dd„Zd%dd„Zd&dd„Zd'dd„Zd(dd„Z			d)d*d d!„Z			d+d,d"d#„Z
dS )-Ú
BasePluginz&Base class for APISpec plugin classes.Úspecr   ÚreturnÚNonec                 C  s   dS )zInitialize plugin with APISpec object

        :param APISpec spec: APISpec object this plugin instance is attached to
        N© )Úselfr   r   r   úG/var/www/Datamplify/venv/lib/python3.10/site-packages/apispec/plugin.pyÚ	init_spec   s    zBasePlugin.init_specÚnameÚstrÚ
definitionÚdictÚkwargsú
typing.Anyúdict | Nonec                 K  ó   t ‚)zöMay 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   r   r   r   r   r   r   Úschema_helper   s   	zBasePlugin.schema_helperÚresponsec                 K  r   )zÂMay return response component description as a dict.

        :param dict response: Response fields
        :param kwargs: All additional keywords arguments sent to `APISpec.response()`
        r   )r   r   r   r   r   r   Úresponse_helper   ó   zBasePlugin.response_helperÚ	parameterc                 K  r   )zÆMay return parameter component description as a dict.

        :param dict parameter: Parameter fields
        :param kwargs: All additional keywords arguments sent to `APISpec.parameter()`
        r   )r   r   r   r   r   r   Úparameter_helper'   r   zBasePlugin.parameter_helperÚheaderc                 K  r   )zºMay return header component description as a dict.

        :param dict header: Header fields
        :param kwargs: All additional keywords arguments sent to `APISpec.header()`
        r   )r   r   r   r   r   r   Úheader_helper/   r   zBasePlugin.header_helperNÚpathú
str | NoneÚ
operationsÚ
parametersúlist[dict] | Nonec                 K  r   )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   r   r!   r"   r   r   r   r   Úpath_helper7   s   zBasePlugin.path_helperc                 K  r   )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   r   r   r   Úoperation_helperQ   s   zBasePlugin.operation_helper)r   r   r	   r
   )r   r   r   r   r   r   r	   r   )r   r   r   r   r	   r   )r   r   r   r   r	   r   )r   r   r   r   r	   r   )NNN)
r   r    r!   r   r"   r#   r   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    





üýr   )	r)   Ú
__future__r   ÚtypingÚcorer   Ú
exceptionsr   r   r   r   r   r   Ú<module>   s    