o
    .&ßa@-  ã                   @   s|   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ dZdd„ Z	dd	d
„Z		ddd„Z
dd„ Z					ddd„ZdS )é    N)ÚRequestParamsDocumenter)ÚResponseParamsDocumenter)ÚResponseExampleDocumenter)ÚRequestExampleDocumenterz'https://docs.aws.amazon.com/goto/WebAPIc                 C   s<   t  | ¡}i }|D ]\}}| d¡st  |¡r|||< q	|S )a  Retrieves an objects public methods

    :param instance: The instance of the class to inspect
    :rtype: dict
    :returns: A dictionary that represents an instance's methods where
        the keys are the name of the methods and the
        values are the handler to the method.
    Ú_)ÚinspectÚ
getmembersÚ
startswithÚismethod)ÚinstanceÚinstance_membersÚinstance_methodsÚnameÚmember© r   ú6/usr/lib/python3/dist-packages/botocore/docs/method.pyÚget_instance_public_methods   s   
	

€r   c           	      C   s~   i }|j r	|j j}t| ¡ ƒ}|dur|D ]}| |j¡ q|dur0|D ]}||v r/| |¡ q$d}|r6d}| j ||¡ dS )a;  Documents the signature of a model-driven method

    :param section: The section to write the documentation to.

    :param name: The name of the method

    :param operation_model: The operation model for the method

    :type include: Dictionary where keys are parameter names and
        values are the shapes of the parameter names.
    :param include: The parameter shapes to include in the documentation.

    :type exclude: List of the names of the parameters to exclude.
    :param exclude: The names of the parameters to exclude from
        documentation.
    NÚ z**kwargs)	Úinput_shapeÚmembersÚlistÚkeysÚappendr   ÚremoveÚstyleÚstart_sphinx_py_method)	Úsectionr   Úoperation_modelÚincludeÚexcludeÚparamsÚparameter_namesr   Úsignature_paramsr   r   r   Údocument_model_driven_signature*   s    
€r#   c                 C   sR   t  |¡}t j|jdd… |j|j|jd�}| d¡}| d¡}| j	 
||¡ dS )a3  Documents the signature of a custom method

    :param section: The section to write the documentation to.

    :param name: The name of the method

    :param method: The handle to the method being documented

    :type include: Dictionary where keys are parameter names and
        values are the shapes of the parameter names.
    :param include: The parameter shapes to include in the documentation.

    :type exclude: List of the names of the parameters to exclude.
    :param exclude: The names of the parameters to exclude from
        documentation.
    é   N)ÚargsÚvarargsÚvarkwÚdefaultsú(ú))r   ÚgetfullargspecÚformatargspecr%   r&   r'   r(   ÚlstripÚrstripr   r   )r   r   Úmethodr   r   Úargspecr"   r   r   r   Údocument_custom_signatureQ   s   
ü

r1   c                 C   sF   t | ||ƒ |  d¡}| d¡ t |¡}|dur!|j |¡ dS dS )zÕDocuments a non-data driven method

    :param section: The section to write the documentation to.

    :param method_name: The name of the method

    :param method: The handle to the method being documented
    úmethod-intror   N)r1   Úadd_new_sectionÚwritelnr   Úgetdocr   Úwrite_py_doc_string)r   Úmethod_namer/   Úmethod_intro_sectionÚ
doc_stringr   r   r   Údocument_custom_methodo   s   	ÿ


ÿr:   Tc                 C   s¤  |rt | ||||d� |  d¡}| |¡ |jr'|j ¡  | d¡ |j ¡  |jj	 
d¡}|durQ|j ¡  | d¡ dt||jf }|jjd|d	� | d
¡ |  d¡}|j ¡  |j d¡ d| ¡ | ¡ | ¡ dœi}|jr‡t|jj|j||d�j||j|||d� n|j ¡  |j ¡  | |d ¡ |  d¡}|jr³t|jj|j||d�j||j||d� |  d¡}|j ¡  |jdu�rK|
�rK| d¡ |j ¡  | d¡ |j ¡  |j ¡  | ¡ }|rù| d¡}|j ¡  | d¡ |j ¡  | d¡}|j ¡  |j d¡ |j ¡  t|jj|j||d�j||j||	d� | d¡}|j ¡  |j d¡ |j ¡  t|jj|j||d�j||j||	d� dS | d¡ dS )a.  Documents an individual method

    :param section: The section to write to

    :param method_name: The name of the method

    :param operation_model: The model of the operation

    :param event_emitter: The event emitter to use to emit events

    :param example_prefix: The prefix to use in the method example.

    :type include_input: Dictionary where keys are parameter names and
        values are the shapes of the parameter names.
    :param include_input: The parameter shapes to include in the
        input documentation.

    :type include_output: Dictionary where keys are parameter names and
        values are the shapes of the parameter names.
    :param include_input: The parameter shapes to include in the
        output documentation.

    :type exclude_input: List of the names of the parameters to exclude.
    :param exclude_input: The names of the parameters to exclude from
        input documentation.

    :type exclude_output: List of the names of the parameters to exclude.
    :param exclude_input: The names of the parameters to exclude from
        output documentation.

    :param document_output: A boolean flag to indicate whether to
        document the output.

    :param include_signature: Whether or not to include the signature.
        It is useful for generating docstrings.
    )r   r   r2   zªThis operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.ÚuidNz
See also: z%s/%s/%szAWS API Documentation)ÚtitleÚlinkr   ÚexamplezRequest SyntaxÚspecial_shape_types)Ústreaming_input_shapeÚstreaming_output_shapeÚeventstream_output_shape)Úservice_nameÚoperation_nameÚevent_emitterÚcontext)Úprefixr   r   z()zrequest-paramsÚreturnz:rtype: dictz
:returns: zevent-streamzêThe response of this operation contains an :class:`.EventStream` member. When iterated the :class:`.EventStream` will yield events based on the structure below, where only one of the top level keys will be present for any given event.zResponse SyntaxÚdescriptionzResponse Structurez:returns: None) r#   r3   Úinclude_doc_stringÚ
deprecatedr   Ústart_dangerr4   Ú
end_dangerÚservice_modelÚmetadataÚgetÚnew_paragraphÚwriteÚAWS_DOC_BASEr   Úexternal_linkÚboldÚget_streaming_inputÚget_streaming_outputÚget_event_stream_outputr   r   rC   Údocument_exampleÚstart_codeblockr   Údocument_paramsÚnew_lineÚoutput_shapeÚindentr   r   )r   r7   r   rE   Úmethod_descriptionÚexample_prefixÚinclude_inputÚinclude_outputÚexclude_inputÚexclude_outputÚdocument_outputÚinclude_signaturer8   Úservice_uidr=   Úexample_sectionrF   Úrequest_params_sectionÚreturn_sectionÚevent_stream_outputÚevent_sectionÚreturn_example_sectionÚreturn_description_sectionr   r   r   Údocument_model_driven_method�   sÒ   +þ


ÿ


ÿÿ


ýÿýú


ýû








ÿ



üú	ÿ

ü
úro   )NN)NNNNNNTT)r   Úbotocore.docs.paramsr   r   Úbotocore.docs.exampler   r   rS   r   r#   r1   r:   ro   r   r   r   r   Ú<module>   s$   
ÿ(
ÿû