U
    N8ÚcÇ.  ã                   @   sf   d dl Z d dlZd dlmZmZ d dlmZ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)ÚRequestExampleDocumenterÚResponseExampleDocumenter)ÚRequestParamsDocumenterÚResponseParamsDocumenterz'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)ÚinstanceZinstance_membersZinstance_methodsÚnameÚmember© r   ú8/tmp/pip-unpacked-wheel-ozje0y8b/botocore/docs/method.pyÚget_instance_public_methods   s    	



r   c           	      C   s~   i }|j r|j j}t| ¡ ƒ}|dk	r<|D ]}| |j¡ q*|dk	r`|D ]}||krH| |¡ qHd}|rld}| 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ÚparamsZparameter_namesr   Úsignature_paramsr   r   r   Údocument_model_driven_signature.   s    r    c           
      C   sŠ   t  |¡}t|tjƒr`tt|jƒƒ}|j| j}|t j	j
ks@t‚|j ¡ }||= |j| ¡ d}t|ƒ 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.
    )Ú
parametersú(ú)N)r   Ú	signatureÚ
isinstanceÚtypesÚFunctionTypeÚnextÚiterr!   ÚkindÚ	ParameterÚPOSITIONAL_OR_KEYWORDÚAssertionErrorÚcopyÚreplaceÚvaluesÚstrÚlstripÚrstripr   r   )
r   r   Úmethodr   r   r$   Z
self_paramZ	self_kindÚ
new_paramsr   r   r   r   Údocument_custom_signatureV   s    


r6   c                 C   sB   t | ||ƒ |  d¡}| d¡ t |¡}|dk	r>|j |¡ 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)r6   Úadd_new_sectionÚwritelnr   Úgetdocr   Zwrite_py_doc_string)r   Úmethod_namer4   Úmethod_intro_sectionZ
doc_stringr   r   r   Údocument_custom_methody   s    	


r=   Tc                 C   s®  |rt | ||||d |  d¡}| |¡ |jrN|j ¡  | d¡ |j ¡  |jj	 
d¡}|dk	r¨|j ¡  | d¡ t› d|› d|j› }|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rpt|jj|j||dj||j||d |  d¡}|j ¡  |jdk	r |
r | 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 n
| 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   r7   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AWS API Documentation)ÚtitleÚlinkr   zrequest-examplezRequest SyntaxZspecial_shape_types)Zstreaming_input_shapeZstreaming_output_shapeZeventstream_output_shape)Úservice_nameZ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-examplezResponse SyntaxÚdescriptionzResponse Structurez:returns: None) r    r8   Zinclude_doc_stringÚ
deprecatedr   Zstart_dangerr9   Z
end_dangerZservice_modelÚmetadataÚgetZnew_paragraphÚwriteÚAWS_DOC_BASEr   Zexternal_linkZboldZget_streaming_inputZget_streaming_outputZget_event_stream_outputr   r   rB   Zdocument_exampleZstart_codeblockr   Zdocument_paramsÚnew_lineZoutput_shapeÚindentr   r   )r   r;   r   rC   Zmethod_descriptionZexample_prefixZinclude_inputZinclude_outputZexclude_inputZexclude_outputZdocument_outputZinclude_signaturer<   Zservice_uidrA   Zexample_sectionrD   Zrequest_params_sectionZreturn_sectionZevent_stream_outputZevent_sectionZreturn_example_sectionZreturn_description_sectionr   r   r   Údocument_model_driven_methodŠ   sæ    3û	


ÿ


 ÿ


ýÿüö


ü÷








ÿ
ÿ

ü÷ÿ

ü÷rO   )NN)NN)NNNNNNTT)r   r&   Zbotocore.docs.exampler   r   Zbotocore.docs.paramsr   r   rL   r   r    r6   r=   rO   r   r   r   r   Ú<module>   s*      ÿ
)   ÿ
#        ô