HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/botocore/docs/__pycache__/client.cpython-310.pyc
o

<&�a�2�@s�ddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlmZdd	l
mZd
d�ZGdd
�d
e�ZGdd�de�ZdS)�)�get_official_service_name��document_custom_method)�document_model_driven_method)�get_instance_public_methods)�document_shared_examples)�ResponseExampleDocumenter)�ResponseParamsDocumenter)�DocumentedShape)�OrderedDictcKs|dkrdS|dvS)N�generate_presigned_url)�s3�)�method_name�service_name�kwargsrr�6/usr/lib/python3/dist-packages/botocore/docs/client.py�!_allowlist_generate_presigned_urlsrc@s�eZdZegZd dd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)!�ClientDocumenterNcCs.||_||_|jduri|_|jjjj|_dS�N)�_client�_shared_examples�meta�
service_modelr�
_service_name)�self�client�shared_examplesrrr�__init__#s

zClientDocumenter.__init__cCs8|�|�|�|�|��}|�||�|�||�dS)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_methodsrrr�document_client*s


z ClientDocumenter.document_clientcCst|j�}|�|�Sr)rr�_filter_client_methods)rr%rrrr!5s

z$ClientDocumenter._get_client_methodscCs8i}|��D]\}}|j|||jd�}|r|||<q|S)N)�methodrr)�items�_filter_client_methodr)rr%�filtered_methodsrr(�includerrrr'9s��z'ClientDocumenter._filter_client_methodscKs.|jD]}|di|��}|dur|SqdS)NTr)�_CLIENT_METHODS_FILTERS)rr�filter�filter_includerrrr*Es
�z&ClientDocumenter._filter_client_methodcC�|j�d�dS)N�Client��style�h2�rr$rrrrO�zClientDocumenter._add_titlecCs�|�d�}t|jjj�}|�d|�|j��|�|jjjj	�|�
|�|j��|�d�|j��|jjj}t
|�D]}|j�d||f�q>dS)N�introz"A low-level client representing %sz These are the available methods:z:py:meth:`~%s.Client.%s`)�add_new_sectionrrrr�writer3�new_line�include_doc_string�
documentation�_add_client_creation_example�	__class__�__name__�sorted�li)rr$r%�official_service_name�
class_namerrrrr"Rs&
��






��z"ClientDocumenter._add_client_introcCs|jjd|jjjd�dS)Nz	%s.Client�rC)r3�start_sphinx_py_classrr>r?r5rrrr hs
�z%ClientDocumenter._add_class_signaturecCs6|j��|j��|�dj|jd��|j��dS)Nz+client = session.create_client('{service}'))�service)r3�start_codeblockr:r9�formatr�
end_codeblockr5rrrr=ls

��z-ClientDocumenter._add_client_creation_examplecCs.|�d�}t|�D]}|�||||�q	dS)N�methods)r8r@�_add_client_method)rr$r%rrrrr#us

��z$ClientDocumenter._add_client_methodscCs6|�|�}|�|�r|�|||�dS|�||�dSr)r8�_is_custom_method�_add_custom_method�_add_model_driven_method�rr$rr(rrrrK{s

z#ClientDocumenter._add_client_methodcCs||jjjvSr)rr�method_to_api_mapping)rrrrrrL�sz"ClientDocumenter._is_custom_methodcCst|||�dSrrrOrrrrM�r6z#ClientDocumenter._add_custom_methodcCsb|�d�}|j��|j�d�|j��|jjj}|jD]}d||jf}|j�	d|�qdS)N�
exceptions�
Exceptions�%s.Client.exceptions.%s�:py:class:`%s`)
r8r3r:�boldrr>r?�error_shapes�namerA)rr$�operation_model�
error_section�client_name�errorrCrrr�_add_method_exceptions_list�s




�z,ClientDocumenter._add_method_exceptions_listcCs~|jjj}|jjj|}|�|�}d|}t||||jjj|j|d�|jr,|�	||�|j
�|�}|r=t||||�dSdS)Nzresponse = client.%s)�
event_emitter�method_description�example_prefix)
rrrrPrXr�eventsr<rVr\r�getr)rr$rr�operation_namerXr_rrrrrN�s$

���z)ClientDocumenter._add_model_driven_methodr)r?�
__module__�__qualname__rr-rr&r!r'r*rr"r r=r#rKrLrMr\rNrrrrrs$�

	
rc@s�eZdZdZedddededddd�fd	ed	dd
d�fg�d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(S))�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.)rW�	type_namer<�Messagez;A descriptive message explaining why the exception occured.)rWrjr<�memberscCs||_|jjjj|_dSr)rrrrr)rrrrrr�sz#ClientExceptionsDocumenter.__init__cCs,|�|�|�|�|�|�|�|�dSr)r�
_add_overview�_add_exceptions_list�_add_exception_classesr5rrr�document_exceptions�s


z.ClientExceptionsDocumenter.document_exceptionscCr0)NzClient Exceptionsr2r5rrrr�r6z%ClientExceptionsDocumenter._add_titlecCs>|j��|�d�|jjd|jd�|�d�|j��dS)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�.)r3r:r9�
external_link�_USER_GUIDE_LINKr5rrrrm�s
��
z(ClientExceptionsDocumenter._add_overviewcCs|jjj}d||jfS)NrS)rr>r?rW)r�shape�cls_namerrr�_exception_class_name�s
z0ClientExceptionsDocumenter._exception_class_namecCsx|jjjj}|s|j��|�d�|j��dS|j��|�d�|j��|D]}|�|�}|j�d|�q*dS)Nz-This client has no modeled exception classes.z$The available client exceptions are:rT)	rrrrVr3r:r9rxrA)rr$rVrvrCrrrrn�s






�z/ClientExceptionsDocumenter._add_exceptions_listcCs"|jjjjD]}|�||�qdSr)rrrrV�_add_exception_class�rr$rvrrrro�s�z1ClientExceptionsDocumenter._add_exception_classescCsV|�|j�}|�|�}|jj|d�|�||�|�||�|�||�|j��dS)NrD)	r8rWrxr3rE�_add_top_level_documentation�_add_exception_catch_example�_add_response_attr�end_sphinx_py_class)rr$rv�
class_sectionrCrrrry�s
z/ClientExceptionsDocumenter._add_exception_classcCs.|jr|j��|�|j�|j��dSdSr)r<r3r:r;rzrrrr{s

�z7ClientExceptionsDocumenter._add_top_level_documentationcCs�|j��|j�d�|j��|�d�|j��|j��|�d�|j��|j��|�d|j�|j��|j��|�d�|j��|j��dS)N�Exampleztry:z...z!except client.exceptions.%s as e:zprint(e.response))	r3r:rUrGr9�indent�dedentrWrIrzrrrr|	s











z7ClientExceptionsDocumenter._add_exception_catch_examplecCsF|�d�}|j�d�|�|�|�||�|�||�|j��dS)N�response)r8r3�start_sphinx_py_attr�_add_response_attr_description�_add_response_example�_add_response_params�end_sphinx_py_attr)rr$rv�response_sectionrrrr}s

z-ClientExceptionsDocumenter._add_response_attrcCs"|j��|�d�|j��dS)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.)r3r:r;r5rrrr�"s

�z9ClientExceptionsDocumenter._add_response_attr_descriptioncCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)N�syntax�Syntax�rrbr]�r,)r8r3r:rU�
new_paragraphrrrrr`�document_example�_GENERIC_ERROR_SHAPE)rr$rv�example_section�
documenterrrrr�,�


�

�z0ClientExceptionsDocumenter._add_response_examplecCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)N�	Structurer�r�)r8r3r:rUr�r	rrrr`�document_paramsr�)rr$rv�params_sectionr�rrrr�:r�z/ClientExceptionsDocumenter._add_response_paramsN)r?rcrdrur
rr�rrprrmrxrnroryr{r|r}r�r�r�rrrrre�sD�����	
reN)�botocore.docs.utilsr�botocore.docs.methodrrr�botocore.docs.sharedexampler�botocore.docs.exampler�botocore.docs.paramsr	r
�botocore.compatrr�objectrrerrrr�<module>s