File: //usr/lib/python3/dist-packages/botocore/docs/__pycache__/shape.cpython-310.pyc
o
.&�a� � @ s d dl mZ G dd� de�ZdS )� )�is_json_value_headerc @ sB e Zd ZdZ ddd�Z ddd�Zdd � Zd
d� Zdd
� ZdS )�ShapeDocumenter� Nc C s2 || _ || _|| _|| _|d u rdi 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 �5/usr/lib/python3/dist-packages/botocore/docs/shape.py�__init__ s
��zShapeDocumenter.__init__Fc
C s� |j }t|di ��d�rd}|j|v r| j|||d� dS |�|j� t|�dk} t|d�r3|jr3d}t| d| | j �||||||| |d � | rY| j
jd
| j| j
| j|f |d� t|�dk}
|
rq| j
jd
| j| j
| jf |d� |�� dS )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�documentzdocument_shape_type_%s)�historyr �include�exclude�is_top_level_param�is_requiredzdocs.%s.%s.%s.%s)�section� zdocs.%s.%s.%s.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$ sH
������z+ShapeDocumenter.traverse_and_document_shapec C s dddddd�}| � ||�S )Nz({...}|[...]|123|123.4|'string'|True|Nonez
b'bytes'|filezStreamingBody()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_default] � �z'ShapeDocumenter._get_special_py_defaultc C s dddddd�}| � ||�S )Nz:ref:`document<document>`zJSON serializablez"bytes or seekable file-like objectz:class:`.StreamingBody`z:class:`.EventStream`r/ r5 )r
r+ �special_type_namesr r r �_get_special_py_type_nameg r9 z)ShapeDocumenter._get_special_py_type_namec C s` t |�r|d S t|d�r|jr|d S | jd �� D ]\}}||v r-||kr-|| S qd S )Nr1 r r0 r )r r&