o
    è’OjN  ã                   @   s   d dl mZ G dd„ dƒZdS )é    )Úis_json_value_headerc                   @   sF   e Zd ZdZ	ddd„Z				ddd„Zdd	„ Zd
d„ Zdd„ ZdS )ÚShapeDocumenterÚ Nc                 C   s2   || _ || _|| _|| _|d u rdi i| _d S d S )NÚspecial_shape_types)Ú_service_nameÚ_operation_nameÚ_event_emitterÚ_context)ÚselfÚservice_nameÚoperation_nameÚevent_emitterÚcontext© r   úY/var/www/html/pharmsmart-cdr-gen/venv/lib/python3.10/site-packages/botocore/docs/shape.pyÚ__init__   s   ÿzShapeDocumenter.__init__Fc              
   C   s  |j }t|di ƒ d¡rd}|j|v r| j|||d� dS | |j¡ t|ƒdk}	t|dƒr3|jr3d}t| d|› �| j	ƒ|||||||	|d	� |	r`| j
jd
| j› d| j› d| j› d|› �|d� t|ƒdk}
|
r}| j
jd
| j› d| j› d| j› d�|d� | ¡  dS )aÿ  Traverses and documents a shape

        Will take a self class and call its appropriate methods as a shape
        is traversed.

        :param section: The section to document.

        :param history: A list of the names of the shapes that have been
            traversed.

        :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.

        :param name: The name of the shape.

        :param is_required: If the shape is a required member.
        ÚserializationÚeventstreamÚevent_stream)Únameé   Úis_document_typeÚdocumentÚdocument_shape_type_)Úhistoryr   ÚincludeÚexcludeÚis_top_level_paramÚis_requiredzdocs.Ú.)Úsectioné   z.complete-sectionN)Ú	type_nameÚgetattrÚgetr   Údocument_recursive_shapeÚappendÚlenÚhasattrr   Údocument_shape_defaultr   ÚemitÚ
EVENT_NAMEr   r   Úpop)r
   r    Úshaper   r   r   r   r   Ú
param_typer   Úat_overlying_method_sectionr   r   r   Útraverse_and_document_shape#   sF    
ýô þþz+ShapeDocumenter.traverse_and_document_shapec                 C   s   ddddddœ}|   ||¡S )Nz({...}|[...]|123|123.4|'string'|True|Nonezb'bytes'|filezStreamingBody()zEventStream()©Údocument_typeÚjsonvalue_headerÚstreaming_input_shapeÚstreaming_output_shapeÚeventstream_output_shape©Ú_get_value_for_special_type)r
   r-   Úspecial_defaultsr   r   r   Ú_get_special_py_defaulth   ó   ûz'ShapeDocumenter._get_special_py_defaultc                 C   s   ddddddœ}|   ||¡S )Nz:ref:`document<document>`zJSON serializablez"bytes or seekable file-like objectz:class:`.StreamingBody`z:class:`.EventStream`r1   r7   )r
   r-   Úspecial_type_namesr   r   r   Ú_get_special_py_type_namer   r;   z)ShapeDocumenter._get_special_py_type_namec                 C   s`   t |ƒr|d S t|dƒr|jr|d S | jd  ¡ D ]\}}||v r-||kr-||   S qd S )Nr3   r   r2   r   )r   r(   r   r	   Úitems)r
   r-   Úspecial_type_mapÚspecial_typeÚmarked_shaper   r   r   r8   |   s   ÿ
þ€z+ShapeDocumenter._get_value_for_special_type)N)NNNF)	Ú__name__Ú
__module__Ú__qualname__r+   r   r0   r:   r=   r8   r   r   r   r   r      s    
ÿ
øE

r   N)Úbotocore.utilsr   r   r   r   r   r   Ú<module>   s   