a
    ތxd<                     @   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   sT   g }| D ]F}t |j}|j}|d r4|d d }q|d dkr||d  q|S )zHelper 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   H/var/www/html/Ranjet/env/lib/python3.9/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'   s    r   c                 C   sP   t | }i }|D ]8\}}|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       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;   s    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   sp   | j   | j | | j   | j   | | | j   |d url| d|  d| d | j   d S )NzFor more information about z1 refer to the :ref:`Resources Introduction Guide<z>`.)stylenew_lineZh3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__X   s    zDocumentModifiedShape.__init__c                 K   sd   | j |jdkr| || |jD ]:}||}| j |jdkrR| || 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?   `   s    

z>DocumentModifiedShape.replace_documentation_for_matching_shapec                 C   s   | ds| dr0|  |  || j | dsD| drd}|jD ]}||vrN|| qN|d}|  || j |d}|	 
d d	r|  |d
|j d| j  n|  |jd| j d 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<   n   s4    


z,DocumentModifiedShape._replace_documentationN)__name__
__module____qualname__r8   r?   r<   r   r   r   r   r1   W   s   r1   )N)
r   r   r   r   r   r&   r'   r)   r0   r1   r   r   r   r   <module>   s    
