
    /Jf-                     r    d dl mZ d dlmZ  G d de          Z G d de          Z G d de          Zd	S )
    )ShapeDocumenter)py_type_namec                   f    e Zd ZddZd Z	 ddZ	 ddZ	 ddZ	 	 	 ddZd Z	d	 Z
d
 Zd Zd ZdS )BaseParamsDocumenterNc                 @    g }|                      |||d||           dS )a3  Fills out the documentation for a section given a model shape.

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

        :param shape: The shape of the operation.

        :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)sectionshapehistorynameincludeexclude)traverse_and_document_shape)selfr   r	   r   r   r
   s         W/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/botocore/docs/params.pydocument_paramsz$BaseParamsDocumenter.document_params   sB     (( 	) 	
 	
 	
 	
 	
    c                 $     | j         ||fi | d S N_add_member_documentationr   r   r	   kwargss       r   document_recursive_shapez-BaseParamsDocumenter.document_recursive_shape+   s%    &&w@@@@@@@r   c                 $     | j         ||fi | d S r   r   )r   r   r	   r
   r   r   r   s          r   document_shape_defaultz+BaseParamsDocumenter.document_shape_default.   s'     	'&w@@@@@@@r   c                 2    | j         ||fi | |j        }|                    |j        d|j        j        i          }|                     |           |                     |||d            |                    d          }|                     |           d S )Nr	   contextr   r	   r
   r   zend-list)r   memberadd_new_sectionr   _start_nested_paramr   _end_nested_param)	r   r   r	   r
   r   r   r   param_shapeparam_sections	            r   document_shape_type_listz-BaseParamsDocumenter.document_shape_type_list3   s     	'&w@@@@@l//w0A&B 0 
 
 	  ///((!	 	) 	
 	
 	
 ))*55w'''''r   c                 :    | j         ||fi | |                    dd|j        j        i          }|                     |           |                      ||j                   |                    |j        j        d|j        j        i          }|j                                         |                     |           |                     ||j        |d            |                    d          }	| 	                    |	           | 	                    |	           d S )Nkeyr	   r   r   zend-map)
r   r!   r(   r   r"   valuestyleindentr   r#   )
r   r   r	   r
   r   r   r   key_sectionr%   end_sections
             r   document_shape_type_mapz,BaseParamsDocumenter.document_shape_type_mapE   s>    	'&w@@@@@--GUY^4 . 
 
 	  ---&&{EI>>>//Kw0@&A 0 
 
 	""$$$  ///((!+	 	) 	
 	
 	
 --i88{+++{+++++r   c                    |                      |j        |          }|                     |||           |D ]]}	|r|	|v r	||	         }
|                    |	d|
j        i          }|                     |           |                     ||
||	           ^|                    d          }|                     |           d S )N)r   r	   r   r   end-structure)_add_members_to_shapemembersr   r!   r   r"   r   r#   )r   r   r	   r
   r   r   r   r   r2   paramr$   r%   s               r   document_shape_type_structurez2BaseParamsDocumenter.document_shape_type_structure`   s     ,,U]GDD&&wD&AAA 	 	E 5G++!%.K#33)9: 4  M $$]333,,%!	 -     ))/::w'''''r   c                     d S r    r   s       r   r   z.BaseParamsDocumenter._add_member_documentation}   s    r   c                 P    |r#|                                 }|D ]}|||j        <   |S r   )copyr   )r   r2   r   r3   s       r   r1   z*BaseParamsDocumenter._add_members_to_shape   s:     	,llnnG  , ,&+
##r   c                     |                      |          }t          |j                  }d}||                    ||z             n|j                            ||z             |                    d           d S )Nz(%s) -- )_get_special_py_type_namer   	type_namewriter*   italics)r   type_sectionr	   special_py_typepy_typetype_formats         r   "_document_non_top_level_param_typez7BaseParamsDocumenter._document_non_top_level_param_type   s    88??u//& {_<====&&{W'<===3r   c                 j    |j                                          |j                                          d S r   )r*   r+   new_liner   r   s     r   r"   z(BaseParamsDocumenter._start_nested_param   0         r   c                 j    |j                                          |j                                          d S r   )r*   dedentrE   rF   s     r   r#   z&BaseParamsDocumenter._end_nested_param   rG   r   NN)NNN)__name__
__module____qualname__r   r   r   r&   r.   r4   r   r1   rC   r"   r#   r6   r   r   r   r      s        
 
 
 
2A A A >BA A A A >B( ( ( (& >B, , , ,@ ( ( ( (:         ! ! !! ! ! ! !r   r   c                   $    e Zd ZdZdZddZd ZdS )ResponseParamsDocumenterz5Generates the description for the response parameterszresponse-paramsNc                 6   |                     d          }|                    d           |2|j                            d|z             |                    d           |                     d          }|                     ||           |                     d          }|j        r|j                                         t          |dd          r|                     d	          }d
}	d                    d |j	        
                                D                       }
d}|                    |	|
z             |                     d          }|j                            |           |                    |j                   |j                                         d S )N
param-name- %sr:   
param-typeparam-documentationis_tagged_unionFparam-tagged-union-docsaK  .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: %s.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows, c                     g | ]}d |z  S z``%s``r6   .0r(   s     r   
<listcomp>zFResponseParamsDocumenter._add_member_documentation.<locals>.<listcomp>       DDDX^DDDr   z3'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}zparam-unknown-example)r!   r=   r*   boldrC   documentationr+   getattrjoinr2   keys	codeblockinclude_doc_stringnew_paragraph)r   r   r	   r   r   name_sectionr?   documentation_sectiontagged_union_docsnotetagged_union_members_strunknown_code_exampleexamples                r   r   z2ResponseParamsDocumenter._add_member_documentation   s   ..|<<4   ##D4K000s###..|<<//eDDD ' 7 78M N N 	J!'..000u/77 >$+$;$;-% %!%  ,099DDu}/A/A/C/CDDD, ,(8 % "''0H(IJJJ!112IJJ''(<===!44U5HIII##%%%%%r   c                 &     | j         |||fi | d S r   )r4   )r   r   r	   r
   r   s        r    document_shape_type_event_streamz9ResponseParamsDocumenter.document_shape_type_event_stream   s)     	+*7E7MMfMMMMMr   r   )rK   rL   rM   __doc__
EVENT_NAMEr   ro   r6   r   r   rO   rO      sH        ??"J%& %& %& %&NN N N N Nr   rO   c                   :    e Zd ZdZdZ	 d	dZ	 	 	 d
dZd Zd ZdS )RequestParamsDocumenterz4Generates the description for the request parameterszrequest-paramsNc                 b   t          |          dk    r( | j        ||fi | |j                                         |                     |j        |          }t          |          D ]n\  }}	|r|	|v r||	         }
|                    |	d|
j        i          }|j        	                                 |	|j
        v }|                     ||
||	|           o|                    d          }t          |          dk    r|j                                         |j        	                                 d S )N   r	   r   )r   r	   r
   r   is_requiredr0   )lenr   r*   r+   r1   r2   	enumerater!   r   rE   required_membersr   rI   )r   r   r	   r
   r   r   r   r2   ir3   r$   r%   rv   s                r   r4   z5RequestParamsDocumenter.document_shape_type_structure   sf    w<<!*D*7EDDVDDDM  """,,U]GDD!'** 	 	HAu 5G++!%.K#33)9: 4  M ((***5#99K,,%!' -     ))/::w<<!M  """     r   Fc                 Z   |                      |          }|t          |j                  }|r|                    d          }|                    d| d|            |                    d          }	|	j                                         |                    d          }
|
                    d|z             n|                    d          }
|
                    d           |2|
j                            d|z             |
                    d	           |                    d          }|                     ||           |r]|                    d
          }|j        	                                 |j                            d           |                    d	           |j
        r|                    d          }|j        	                                 t          |dd          re|                    d          }d}d                    d |j                                        D                       }|                    ||z             |                    |j
                   |                     ||           |                    d          }|j                                         d S )NrT   z:type z: zend-param-typerQ   z:param %s: rR   rS   r:   zis-requiredz
[REQUIRED]rU   rV   FrW   zl.. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: %s. rX   c                     g | ]}d |z  S rZ   r6   r[   s     r   r]   zERequestParamsDocumenter._add_member_documentation.<locals>.<listcomp>!  r^   r   z	end-param)r;   r   r<   r!   r=   r*   rE   r_   rC   r+   r`   ra   rb   r2   rc   re    _add_special_trait_documentationrf   )r   r   r	   r   is_top_level_paramrv   r   rA   r?   end_type_sectionrg   is_required_sectionrh   ri   rj   rk   end_param_sections                    r   r   z1RequestParamsDocumenter._add_member_documentation   s    0077?"5?33G 	I"22<@@L99999:::+;;<LMM"++---"22<@@L}t34444 #22<@@Lt$$$"''t444""3'''"22<@@L33L%HHH 	+")"9"9-"H"H%,,...%**<888%%c*** 	P$+$;$;%% %! "'..000u/77 K$+$;$;-% %!D 
 ,099DDu}/A/A/C/CDDD, ,( "''0H(IJJJ!44U5HIII112GOOO#33K@@--/////r   c                 F    d|j         v r|                     |           d S d S )NidempotencyToken)metadata!_append_idempotency_documentation)r   r   r	   s      r   r}   z8RequestParamsDocumenter._add_special_trait_documentation)  s1    //227;;;;; 0/r   c                 4    d}|                     |           d S )Nz,This field is autopopulated if not provided.)r=   )r   r   	docstrings      r   r   z9RequestParamsDocumenter._append_idempotency_documentation-  s    B	i     r   rJ   )NFF)	rK   rL   rM   rp   rq   r4   r   r}   r   r6   r   r   rs   rs      sx        >>!J >B! ! ! !@  70 70 70 70r< < <! ! ! ! !r   rs   N)botocore.docs.shaper   botocore.docs.utilsr   r   rO   rs   r6   r   r   <module>r      s    0 / / / / / , , , , , ,I! I! I! I! I!? I! I! I!X/N /N /N /N /N3 /N /N /Nd`! `! `! `! `!2 `! `! `! `! `!r   