o
    6׾g<                     @   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 )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)paramsignore_paramsparamresultcurrent r   Z/var/www/html/backend_erp/backend_erp_env/lib/python3.10/site-packages/boto3/docs/utils.pyget_resource_ignore_params   s   r   c                 C   s
   t | S N)inspect
isfunction)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   
wait_until)r   
getmembers
startswithisupperr   )resource_classresource_class_members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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_nameidentifier_namer   r   r   get_identifier_description?   s   r1   c                 C   st   | j   | j | | j   | j   | | | j   |d ur8| d|  d| d | j   d S d S )NzFor more information about z1 refer to the :ref:`Resources Introduction Guide<z>`.)stylenew_lineh3writelower)sectionresource_typedescription
intro_linkr   r   r   add_resource_type_overviewF   s   




r;   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)self
shape_namenew_typenew_description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r)| || q| || qd S )Nshape)r=   contextget_replace_documentationavailable_sectionsget_section(replace_documentation_for_matching_shape)rA   
event_namer7   kwargssection_namesub_sectionr   r   r   rM   `   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-paramrR   rS   zutf-8z:typez:type z: (z) -- )r   remove_all_sections
clear_textr5   r@   rK   delete_sectionrL   r?   getvaluedecoder!   r>   r2   italics)rA   rN   r7   allowed_sectionsrP   description_sectiontype_sectionr   r   r   rJ   n   s8   



z,DocumentModifiedShape._replace_documentationN)__name__
__module____qualname__rF   rM   rJ   r   r   r   r   r<   W   s    r<   r   )
r   r   r   r   r#   r-   r.   r1   r;   r<   r   r   r   r   <module>   s   
