HEX
Server: nginx/1.24.0
System: Linux webserver 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: wpuser (1002)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/botocore/docs/__pycache__/client.cpython-312.pyc
�

P��e�C���ddlZddlmZddlmZddlmZddlmZddl	m
Z
mZmZddl
mZddlmZdd	lmZmZd
�ZGd�d�ZGd
�d�ZGd�d�Zy)�N)�
xform_name)�OrderedDict)�DocumentStructure)�ResponseExampleDocumenter)�document_custom_method�document_model_driven_method�get_instance_public_methods)�ResponseParamsDocumenter)�document_shared_examples)�DocumentedShape�get_official_service_namec��|dk7ry|dvS)N�generate_presigned_url)�s3�)�method_name�service_name�kwargss   �6/usr/lib/python3/dist-packages/botocore/docs/client.py�!_allowlist_generate_presigned_urlrs���.�.���6�!�!�c�n�eZdZegZdd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zy)�ClientDocumenterNc��||_|jjj|_||_||_|j
�i|_|jjjj|_	y�N)
�_client�	__class__�__name__�_client_class_name�_root_docs_path�_shared_examples�meta�
service_modelr�
_service_name)�self�client�root_docs_path�shared_exampless    r�__init__zClientDocumenter.__init__(sc�����"&�,�,�"8�"8�"A�"A���-��� /���� � �(�$&�D�!�!�\�\�.�.�<�<�I�I��rc��|j|�|j|�|j�}|j||�|j	|�y)z]Documents a client and its methods

        :param section: The section to write to.
        N)�
_add_title�_add_class_signature�_get_client_methods�_add_client_intro�_add_client_methods)r%�section�client_methodss   r�document_clientz ClientDocumenter.document_client1sJ��
	
���� ��!�!�'�*��1�1�3�����w��7�� � ��0rc�N�t|j�}|j|�Sr)r	r�_filter_client_methods)r%r1s  rr-z$ClientDocumenter._get_client_methods<s!��4�T�\�\�B���*�*�>�:�:rc��i}|j�D]+\}}|j|||j��}|s�'|||<�-|S)N)�methodrr)�items�_filter_client_methodr$)r%r1�filtered_methodsrr6�includes      rr4z'ClientDocumenter._filter_client_methods@sa����#1�#7�#7�#9�	7��K���0�0��'�!�/�/�1��G�
�06� ��-�	7� �rc�B�|jD]}|di|��}|��|cSy)NTr)�_CLIENT_METHODS_FILTERS)r%r�filter�filter_includes    rr8z&ClientDocumenter._filter_client_methodLs5���2�2�	&�F�#�-�f�-�N��)�%�%�		&�rc�:�|jjd�y)N�Client��style�h2�r%r0s  rr+zClientDocumenter._add_titleVs���
�
����"rc��|jd�}t|jjj�}|jd|���|jj�|j|jjjj�|j|�|jj�|jj�|jd�|jj�t|�D],}|jj!|j"�d|����.y)N�introz A low-level client representing z These are the available methods:z/client/)�add_new_sectionr
rr"r#�writerB�new_line�include_doc_string�
documentation�_add_client_creation_example�dedent�
new_paragraph�writeln�toctree�sorted�tocitemr$)r%r0r1�official_service_namers     rr.z"ClientDocumenter._add_client_introYs���)�)�'�2�� 9��L�L���+�+�!
��	�
�
�.�/D�.E�F�	
�	�
�
��� ��"�"��L�L���+�+�9�9�	
�
	
�)�)�'�2�	�
�
�����
�
�#�#�%����:�;��
�
����!�.�1�	P�K��M�M�!�!�T�%7�%7�$8���
�"N�O�	Prc�V�|jj|j�d���y)Nz.Client��
class_name)rB�start_sphinx_py_classrrDs  rr,z%ClientDocumenter._add_class_signaturers*���
�
�+�+��1�1�2�'�:�	,�	
rc��|jj�|jj�|jdj	|j
���|jj
�y)Nz+client = session.create_client('{service}'))�service)rB�start_codeblockrIrH�formatr$�
end_codeblockrDs  rrLz-ClientDocumenter._add_client_creation_examplews]���
�
�%�%�'��
�
��� ��
�
�;�B�B��*�*�
C�
�	
�
	�
�
�#�#�%rc��t|�D]l}t|d��}|j||||�tjj|j|jd�}|j||��ny)N�html��targetr&)	rQr�_add_client_method�os�path�joinr r$�
write_to_file)r%r1r�method_doc_structure�client_dir_paths     rr/z$ClientDocumenter._add_client_methods�s}��!�.�1�
	M�K�#4��F�$� �
�#�#�$�k�>�+�3N�
�
!�g�g�l�l��$�$�d�&8�&8�(��O�
!�.�.���L�
	Mrc��|jd�}|jj|jd|j���|jd|���|j
|�|j|d|j�d�i��}|j|�r|j|||�y|j||�y)N�
breadcrumbz../../z / Client / �	qualifierz.Client.)�context)
rGrB�refrr$rH�add_title_section�_is_custom_method�_add_custom_method�_add_model_driven_method)r%r0rr6�breadcrumb_section�method_sections      rraz#ClientDocumenter._add_client_method�s���$�4�4�\�B��� � �$�$��#�#�v�d�.@�.@�-A�%B�	
�	� � �<��}�!=�>��!�!�+�.� �0�0�� �T�%<�%<�$=�X�"F�G�1�
���!�!�+�.��#�#����
�
�)�)�.�+�Frc�F�||jjjvSr)rr"�method_to_api_mapping)r%rs  rrnz"ClientDocumenter._is_custom_method�s���$�,�,�"3�"3�"I�"I�I�Irc��t|||�yr)r)r%r0rr6s    rroz#ClientDocumenter._add_custom_method�s���w��V�<rc�X�|jd�}|jj�|jjd�|jj�|jD];}|j
�d|j��}|jjd|z��=y)N�
exceptions�
Exceptions�.Client.exceptions.z:py:class:`%s`)rGrBrI�bold�error_shapesr�name�li)r%r0�operation_model�
error_section�errorrVs      r�_add_method_exceptions_listz,ClientDocumenter._add_method_exceptions_list�s����/�/��=�
����$�$�&���� � ��.����$�$�&�$�1�1�	B�E��*�*�+�+>�u�z�z�l�K�
�
���"�"�#3�j�#@�A�		Brc��|jjj}|jjj|}|j	|�}d|z}|j
j
dd��|��}t||||jjj|j|��|jr|j||�|jj
|�}|rt||||�yy)Nzresponse = client.%srj�)�
event_emitter�method_description�example_prefix)rr"r#rtr~rk�getr�eventsrKr{r�r!r)	r%r0rr#�operation_namer~r��full_method_namer(s	         rrpz)ClientDocumenter._add_model_driven_method�s������)�)�7�7�
����*�*�@�@��M��'�7�7��G��/�+�=�����"�"�;��3�4�[�M�B�	�	%�����,�,�+�+�2�2�.�<�<�)�
	
��'�'��,�,�W�o�F��/�/�3�3�N�C���$���.�/�
�rr)r�
__module__�__qualname__rr<r)r2r-r4r8r+r.r,rLr/rarnror�rprrrrr#s^��)���J�	1�;�
 ��#�P�2
�
&�M� G�(J�=�	B�rrc��eZdZdZedddededdd��fd	ed	dd
��fg���Zd�Zd
�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�ClientExceptionsDocumenterzQhttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/error-handling.html�Error�	structurez1Normalized access to common exception attributes.�Code�stringz,An identifier specifying the exception type.)r|�	type_namerK�Messagez;A descriptive message explaining why the exception occured.)r|r�rK�membersc���||_|jjj|_|jjj
j|_||_yr)	rrrrr"r#rr$r )r%r&r's   rr)z#ClientExceptionsDocumenter.__init__�sG�����"&�,�,�"8�"8�"A�"A���!�\�\�.�.�<�<�I�I���-��rc��|j|�|j|�|j|�|j�yr)r+�
_add_overview�_add_exceptions_list�_add_exception_classesrDs  r�document_exceptionsz.ClientExceptionsDocumenter.document_exceptions�s6������ ����7�#��!�!�'�*��#�#�%rc�:�|jjd�y)NzClient ExceptionsrArDs  rr+z%ClientExceptionsDocumenter._add_titles���
�
���,�-rc��|jj�|jd�|jjd|j��|jd�|jj�y)Nz�Client exceptions are available on a client instance via the ``exceptions`` property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling z
user guide��title�link�.)rBrIrH�
external_link�_USER_GUIDE_LINKrDs  rr�z(ClientExceptionsDocumenter._add_overviewsf���
�
��� ��
�
�
�	
�	�
�
�#�#���&�&�	$�	
�	�
�
�c���
�
��� rc�8�|j�d|j��S)Nry)rr|)r%�shapes  r�_exception_class_namez0ClientExceptionsDocumenter._exception_class_names���)�)�*�*=�e�j�j�\�J�Jrc���|jjjj}|sF|jj�|j
d�|jj�y|jj�|jd�|jj�|D]6}|jj|j�d|j����8y)Nz-This client has no modeled exception classes.z$The available client exceptions are:z/client/exceptions/)rr"r#r{rBrIrHrOrPrRr$r|)r%r0r{r�s    rr�z/ClientExceptionsDocumenter._add_exceptions_lists����|�|�(�(�6�6�C�C����M�M�"�"�$��M�M�I�J��M�M�"�"�$���
�
��� ����>�?��
�
����!�	�E��M�M�!�!��%�%�&�&9�%�*�*��F�
�	rc�X�|jjjjD]}}t	|j
d��}|j
||�tjj|j|jdd�}|j||j
��y)Nr^r_r&rw)
rr"r#r{rr|�_add_exception_classrbrcrdr r$re)r%r��exception_doc_structure�exception_dir_paths    rr�z1ClientExceptionsDocumenter._add_exception_classes(s����\�\�&�&�4�4�A�A�	�E�&7��
�
�6�'�#�
�%�%�&=�u�E�"$������$�$��"�"���	"��
$�1�1�"�E�J�J�
�	rc�.�|jd�}|jj|jd|j���|jd|j���|j|j�|j|j�}|j|�}|jj|��|j||�|j||�|j||�|jj�y)Nriz	../../../z / Client / exceptions / rU)rGrBrlrr$rHr|rmr�rW�_add_top_level_documentation�_add_exception_catch_example�_add_response_attr�end_sphinx_py_class)r%r0r�rq�
class_sectionrVs      rr�z/ClientExceptionsDocumenter._add_exception_class;s���$�4�4�\�B��� � �$�$��#�#�y��1C�1C�0D�%E�	
�	� � �#<�U�Z�Z�L�!I�J��!�!�%�*�*�-��/�/��
�
�;�
��/�/��6�
����1�1�Z�1�H��)�)�-��?��)�)�-��?����
�u�5����/�/�1rc��|jrP|jj�|j|j�|jj�yyr)rKrBrIrJ�r%r0r�s   rr�z7ClientExceptionsDocumenter._add_top_level_documentationJsD������M�M�"�"�$��&�&�u�':�':�;��M�M�"�"�$�rc��|jj�|jjd�|jj�|jj	�|jd�|jj
�|jj�|jd�|jj�|jj�|jd|jz�|jj
�|jj�|jd�|jj�|jj�y)N�Exampleztry:z...z!except client.exceptions.%s as e:zprint(e.response))
rBrIrzrNrZrH�indentrMr|r\r�s   rr�z7ClientExceptionsDocumenter._add_exception_catch_examplePs����
�
��� ��
�
���9�%��
�
�#�#�%��
�
�%�%�'��
�
�f���
�
�����
�
��� ��
�
�e���
�
�����
�
��� ��
�
�9�E�J�J�F�G��
�
�����
�
��� ��
�
�)�*��
�
�����
�
�#�#�%rc��|jd�}|jjd�|j|�|j	||�|j||�|jj
�y)N�response)rGrB�start_sphinx_py_attr�_add_response_attr_description�_add_response_example�_add_response_params�end_sphinx_py_attr)r%r0r��response_sections    rr�z-ClientExceptionsDocumenter._add_response_attrbsj��"�2�2�:�>�����3�3�J�?��+�+�,<�=��"�"�#3�U�;��!�!�"2�E�:����1�1�3rc��|jj�|jd�|jj�y)Nz�The parsed error response. All exceptions have a top level ``Error`` key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.)rBrIrJrDs  rr�z9ClientExceptionsDocumenter._add_response_attr_descriptionjs7���
�
��� ��"�"�
*�	
�	�
�
��� rc�n�|jd�}|jj�|jjd�|jj	�t|jd|jjj��}|j|||jg��y)N�syntax�Syntax�rr�r��r:)rGrBrIrzrNrr$rr"r��document_example�_GENERIC_ERROR_SHAPE)r%r0r��example_section�
documenters     rr�z0ClientExceptionsDocumenter._add_response_examplets���!�1�1�(�;�����&�&�(����"�"�8�,����+�+�-�.��+�+���,�,�+�+�2�2�
�
�
	�#�#����.�.�/�	$�	
rc�n�|jd�}|jj�|jjd�|jj	�t|jd|jjj��}|j|||jg��y)N�	Structurer�r�)rGrBrIrzrNr
r$rr"r��document_paramsr�)r%r0r��params_sectionr�s     rr�z/ClientExceptionsDocumenter._add_response_params�s��� �0�0��=�����%�%�'����!�!�+�.����*�*�,�-��+�+���,�,�+�+�2�2�
�
�
	�"�"����.�.�/�	#�	
rN)rr�r�r�rrr�r)r�r+r�r�r�r�r�r�r�r�r�r�r�rrrr�r��s���	@��+�
��J���#�#�"*�J�	�	��#�&�"*�'�	�
�
�
�	��>.�&�.�
!�K�
��&
2�%�&�$4�!�
� 
rr�c�8�eZdZdZddd�Zd�Zd�Zd�Zd�Zd	�Z	y
)�ClientContextParamsDocumenterzPhttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html)�
Accelerate�DisableMultiRegionAccessPoints�ForcePathStyle�UseArnRegion)r�)r�	s3controlc� �||_||_yr)r$�_context_params)r%r�context_paramss   rr)z&ClientContextParamsDocumenter.__init__�s��)���-��rc�j�|j|�|j|�|j|�yr)r+r��_add_context_params_listrDs  r�document_context_paramsz5ClientContextParamsDocumenter.document_context_params�s*������ ����7�#��%�%�g�.rc�:�|jjd�y)NzClient Context ParametersrArDs  rr+z(ClientContextParamsDocumenter._add_title�s���
�
���4�5rc��|jj�|jd�|jjd|j��|jd�|jj�y)Nz�Client context parameters are configurable on a client instance via the ``client_context_params`` parameter in the ``Config`` object. For more detailed instructions and examples on the exact usage of context params see the zconfiguration guider�r�)rBrIrHr��_CONFIG_GUIDE_LINKrDs  rr�z+ClientContextParamsDocumenter._add_overview�sf���
�
��� ��
�
�
<�	
�	�
�
�#�#�'��(�(�	$�	
�	�
�
�c���
�
��� rc	�f�|jj�d|j�d�}|jd|�d��|jD]c}|jj�dt|j��d�}|jd|�d|j�d|j����ey)Nz``zThe available z client context params are:z* z (z) - )
rBrIr$rOr�rr|rH�typerK)r%r0�sn�paramr|s     rr�z6ClientContextParamsDocumenter._add_context_params_list�s����
�
��� ��$�$�$�%�R�
(�����.���,G�H�I��)�)�	N�E��M�M�"�"�$��
�5�:�:�.�/�r�2�D��M�M�B�t�f�B�u�z�z�l�$�u�7J�7J�6K�L�M�	NrN)
rr�r�r��OMITTED_CONTEXT_PARAMSr)r�r+r�r�rrrr�r��s8��	?��
�'���.�/�
6�
!�Nrr�)rb�botocorer�botocore.compatr�botocore.docs.bcdoc.restdocr�botocore.docs.exampler�botocore.docs.methodrrr	�botocore.docs.paramsr
�botocore.docs.sharedexampler�botocore.docs.utilsrr
rrr�r�rrr�<module>r�sV��
��'�9�;���
:�@�J�"�n�n�b~
�~
�B2N�2Nr