o
    =_Wc¨  ã                   @   s^   d dl Z d dlZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	ddd„ZG dd„ dƒZ	dS )é    Nc                 C   sZ   g }| D ]&}t  |j¡}|j}|d r|d d }|d s|d dkr*| |d ¡ q|S )zÕHelper method to determine which parameters to ignore for actions

    :returns: A list of the parameter names that does not need to be
        included in a resource's method call for documentation purposes.
    Úchildrenr   ÚtypeÚfieldÚvalue)ÚjmespathÚcompileÚtargetÚparsedÚappend)ÚparamsZignore_paramsÚparamÚresultÚcurrent© r   ú2D:\Flask\env\Lib\site-packages\boto3/docs/utils.pyÚget_resource_ignore_params   s   ÿ€r   c                 C   s
   t  | ¡S ©N)ÚinspectÚ
isfunction)Zaction_handler   r   r   Úis_resource_action'   ó   
r   c                 C   sP   t  | ¡}i }|D ]\}}| d¡s%|d  ¡ s%| d¡s%t|ƒr%|||< q	|S )NÚ_r   Z
wait_until)r   Ú
getmembersÚ
startswithÚisupperr   )Zresource_classZresource_class_membersZresource_methodsÚnameÚmemberr   r   r   Úget_resource_public_actions+   s   


€r   c                 C   s   d  dd„ | D ƒ¡S )Nú,c                 S   s   g | ]}d |› d ‘qS )ú'r   )Ú.0Ú
identifierr   r   r   Ú
<listcomp>8   s    z5get_identifier_values_for_example.<locals>.<listcomp>©Újoin©Zidentifier_namesr   r   r   Ú!get_identifier_values_for_example7   s   r&   c                 C   s
   d  | ¡S )Nr   r#   r%   r   r   r   Ú!get_identifier_args_for_signature;   r   r'   c                 C   s   d| › d|› dS )NzThe z's z" identifier. This **must** be set.r   )Úresource_nameZidentifier_namer   r   r   Úget_identifier_description?   s   ÿr)   c                 C   s   | j  ¡  |  d¡ | j  ¡  | j  ¡  |  |¡ | j  ¡  | j  ¡  |  |¡ | j  ¡  |d urF|  d| ¡ › d|› d¡ | j  ¡  d S d S )Nz.. rst-class:: admonition-titlezFor more information about z1 refer to the :ref:`Resources Introduction Guide<z>`.)ÚstyleÚnew_lineÚwriteÚlower)ÚsectionZresource_typeÚdescriptionZ
intro_linkr   r   r   Úadd_resource_type_overviewF   s"   








ÿÿûr0   c                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚDocumentModifiedShapec                 C   s   || _ || _|| _|| _d S r   )Ú_shape_nameÚ	_new_typeÚ_new_descriptionÚ_new_example_value)ÚselfZ
shape_nameÚnew_typeZnew_descriptionZnew_example_valuer   r   r   Ú__init__[   s   
zDocumentModifiedShape.__init__c                 K   sd   | j |j d¡kr|  ||¡ |jD ]}| |¡}| j |j d¡kr)|  ||¡ q|  ||¡ qd S )NÚshape)r2   ÚcontextÚgetÚ_replace_documentationÚavailable_sectionsÚget_sectionÚ(replace_documentation_for_matching_shape)r6   Ú
event_namer.   ÚkwargsÚsection_nameZsub_sectionr   r   r   r?   c   s   

ÿûz>DocumentModifiedShape.replace_documentation_for_matching_shapec                 C   sî   |  d¡s
|  d¡r| ¡  | ¡  | | j¡ |  d¡s"|  d¡rud}|jD ]}||vr2| |¡ q'| d¡}| ¡  | | j¡ | d¡}| 	¡  
d¡  d	¡rd| ¡  | d
|j› d| j› ¡ d S | ¡  |j d| j› d¡ d S d S )Nzdocs.request-examplezdocs.response-examplezdocs.request-paramszdocs.response-params)z
param-nameúparam-documentationzend-structureú
param-typez	end-paramrC   rD   zutf-8z:typez:type z: ú(z) -- )r   Zremove_all_sectionsZ
clear_textr,   r5   r=   Zdelete_sectionr>   r4   ÚgetvalueÚdecoder   r3   r*   Zitalics)r6   r@   r.   Zallowed_sectionsrB   Zdescription_sectionZtype_sectionr   r   r   r<   q   s8   ÿþÿþ

€

äz,DocumentModifiedShape._replace_documentationN)Ú__name__Ú
__module__Ú__qualname__r8   r?   r<   r   r   r   r   r1   Z   s    r1   r   )
r   r   r   r   r   r&   r'   r)   r0   r1   r   r   r   r   Ú<module>   s   
ÿ