HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/botocore/docs/__pycache__/client.cpython-38.pyc
U

KD�g�C�@s�ddlZddlmZddlmZddlmZddlmZddl	m
Z
mZmZddl
mZddlmZdd	lmZmZd
d�ZGdd
�d
�ZGdd�d�ZGdd�d�ZdS)�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_namecKs|dkrdS|dkS)NZgenerate_presigned_url)�s3�)�method_name�service_name�kwargsrr�A/opt/cppython/lib/python3.8/site-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@||_|jjj|_||_||_|jdkr.i|_|jjjj|_	dS�N)
�_client�	__class__�__name__�_client_class_name�_root_docs_path�_shared_examples�meta�
service_modelr�
_service_name)�self�client�root_docs_path�shared_examplesrrr�__init__(s
zClientDocumenter.__init__cCs6|�|�|�|�|��}|�||�|�|�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_client1s


z ClientDocumenter.document_clientcCst|j�}|�|�Sr)rr�_filter_client_methods)rr*rrrr&<s
z$ClientDocumenter._get_client_methodscCs8i}|��D]&\}}|j|||jd�}|r|||<q|S)N)�methodrr)�items�_filter_client_methodr)rr*Zfiltered_methodsrr-�includerrrr,@s�
z'ClientDocumenter._filter_client_methodscKs*|jD]}|f|�}|dk	r|SqdS)NT)�_CLIENT_METHODS_FILTERS)rr�filterZfilter_includerrrr/Ls



z&ClientDocumenter._filter_client_methodcCs|j�d�dS)NZClient��styleZh2�rr)rrrr$VszClientDocumenter._add_titlecCs�|�d�}t|jjj�}|�d|���|j��|�|jjjj	�|�
|�|j��|j��|�
d�|j��t|�D]}|j�|j�d|���q~dS)NZintroz A low-level client representing z These are the available methods:z/client/)�add_new_sectionrrrr�writer4�new_line�include_doc_string�
documentation�_add_client_creation_example�dedent�
new_paragraph�writeln�toctree�sorted�tocitemr)rr)r*Zofficial_service_namerrrrr'Ys$
��

�




z"ClientDocumenter._add_client_introcCs|jj|j�d�d�dS)Nz.Client��
class_name)r4�start_sphinx_py_classrr5rrrr%rs
�z%ClientDocumenter._add_class_signaturecCs6|j��|j��|�d|j�d��|j��dS)Nz client = session.create_client('z'))r4�start_codeblockr8r7r�
end_codeblockr5rrrr;ws

�z-ClientDocumenter._add_client_creation_examplecCsPt|�D]B}t|dd�}|�||||�tj�|j|jd�}|�||�qdS)N�html��targetr )	r@r�_add_client_method�os�path�joinrr�
write_to_file)rr*rZmethod_doc_structureZclient_dir_pathrrrr(s ���z$ClientDocumenter._add_client_methodscCs�|�d�}|j�|jd|j���|�d|���|�|�|j|d|j�d�id�}|�|�rp|�|||�n|�	||�dS)N�
breadcrumbz../../z / Client / �	qualifierz.Client.)�context)
r6r4�refrrr7�add_title_section�_is_custom_method�_add_custom_method�_add_model_driven_method)rr)rr-�breadcrumb_sectionZmethod_sectionrrrrJ�s$

�
�
�z#ClientDocumenter._add_client_methodcCs||jjjkSr)rr�method_to_api_mapping)rrrrrrT�sz"ClientDocumenter._is_custom_methodcCst|||�dSr)r)rr)rr-rrrrU�sz#ClientDocumenter._add_custom_methodcCs`|�d�}|j��|j�d�|j��|jD]*}|j�d|j��}|j�d|�d��q0dS)N�
exceptionsZ
Exceptions�.Client.exceptions.z:py:class:`�`)r6r4r8�bold�error_shapesr�nameZli)rr)�operation_modelZ
error_section�errorrCrrr�_add_method_exceptions_list�s



�z,ClientDocumenter._add_method_exceptions_listc	Cs�|jjj}|jjj|}|�|�}d|��}|j�dd��|��}t||||jjj|j	|d�|j
rp|�||�|j�|�}|r�t
||||�dS)Nzresponse = client.rP�)�
event_emitterZmethod_description�example_prefix)rrrrXr_rQ�getr�eventsr:r]rarr
)	rr)rr�operation_namer_rdZfull_method_namer"rrrrV�s0


��
�z)ClientDocumenter._add_model_driven_method)N)r�
__module__�__qualname__rr1r#r+r&r,r/r$r'r%r;r(rJrTrUrarVrrrrr#s"�
	
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�ErrorZ	structurez1Normalized access to common exception attributes.ZCode�stringz,An identifier specifying the exception type.)r^�	type_namer:�Messagez;A descriptive message explaining why the exception occured.)r^rmr:�memberscCs*||_|jjj|_|jjjj|_||_dSr)	rrrrrrrrr)rr r!rrrr#�sz#ClientExceptionsDocumenter.__init__cCs*|�|�|�|�|�|�|��dSr)r$�
_add_overview�_add_exceptions_list�_add_exception_classesr5rrr�document_exceptions�s


z.ClientExceptionsDocumenter.document_exceptionscCs|j�d�dS)NzClient Exceptionsr3r5rrrr$sz%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�.)r4r8r7�
external_link�_USER_GUIDE_LINKr5rrrrps
��
z(ClientExceptionsDocumenter._add_overviewcCs|j�d|j��S)NrZ)rr^)r�shaperrr�_exception_class_namesz0ClientExceptionsDocumenter._exception_class_namecCsx|jjjj}|s2|j��|�d�|j��dS|j��|�d�|j��|D]}|j�	|j
�d|j���qTdS)Nz-This client has no modeled exception classes.z$The available client exceptions are:z/client/exceptions/)rrrr]r4r8r7r>r?rArr^)rr)r]rzrrrrqs





�z/ClientExceptionsDocumenter._add_exceptions_listcCsT|jjjjD]B}t|jdd�}|�||�tj�	|j
|jdd�}|�||j�qdS)NrGrHr rY)
rrrr]rr^�_add_exception_classrKrLrMrrrN)rrzZexception_doc_structureZexception_dir_pathrrrrr&s ���z1ClientExceptionsDocumenter._add_exception_classescCs�|�d�}|j�|jd|j���|�d|j���|�|j�|�|j�}|�|�}|jj	|d�|�
||�|�||�|�||�|j�
�dS)NrOz	../../../z / Client / exceptions / rB)r6r4rRrrr7r^rSr{rD�_add_top_level_documentation�_add_exception_catch_example�_add_response_attrZend_sphinx_py_class)rr)rzrWZ
class_sectionrCrrrr|9s

�
z/ClientExceptionsDocumenter._add_exception_classcCs*|jr&|j��|�|j�|j��dSr)r:r4r8r9�rr)rzrrrr}Hs
z7ClientExceptionsDocumenter._add_top_level_documentationcCs�|j��|j�d�|j��|j��|�d�|j��|j��|�d�|j��|j��|�d|j�d��|j��|j��|�d�|j��|j�	�dS)NZExampleztry:z...zexcept client.exceptions.z as e:zprint(e.response))
r4r8r\r=rEr7�indentr<r^rFr�rrrr~Ns 












z7ClientExceptionsDocumenter._add_exception_catch_examplecCsF|�d�}|j�d�|�|�|�||�|�||�|j��dS)N�response)r6r4Zstart_sphinx_py_attr�_add_response_attr_description�_add_response_example�_add_response_paramsZend_sphinx_py_attr)rr)rzZresponse_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.)r4r8r9r5rrrr�hs

�z9ClientExceptionsDocumenter._add_response_attr_descriptioncCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)N�syntax�Syntax�rrgrc�r0)r6r4r8r\r=rrrrrfZdocument_example�_GENERIC_ERROR_SHAPE)rr)rzZexample_section�
documenterrrrr�rs


��z0ClientExceptionsDocumenter._add_response_examplecCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)NZ	Structurer�r�)r6r4r8r\r=r	rrrrfZdocument_paramsr�)rr)rzZparams_sectionr�rrrr��s


��z/ClientExceptionsDocumenter._add_response_paramsN)rrhriryrrr�r#rsr$rpr{rqrrr|r}r~rr�r�r�rrrrrj�sL��������
rjc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ClientContextParamsDocumenterzPhttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html)Z
AccelerateZDisableMultiRegionAccessPointsZForcePathStyle�UseArnRegion)r�)r
Z	s3controlcCs||_||_dSr)r�_context_params)rrZcontext_paramsrrrr#�sz&ClientContextParamsDocumenter.__init__cCs"|�|�|�|�|�|�dSr)r$rp�_add_context_params_listr5rrr�document_context_params�s

z5ClientContextParamsDocumenter.document_context_paramscCs|j�d�dS)NzClient Context Parametersr3r5rrrr$�sz(ClientContextParamsDocumenter._add_titlecCs>|j��|�d�|jjd|jd�|�d�|j��dS)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 guidertrw)r4r8r7rx�_CONFIG_GUIDE_LINKr5rrrrp�s
��
z+ClientContextParamsDocumenter._add_overviewc	Csv|j��d|j�d�}|�d|�d��|jD]@}|j��dt|j��d�}|�d|�d|j�d|j	���q0dS)Nz``zThe available z client context params are:z* z (z) - )
r4r8rr>r�rr^r7�typer:)rr)Zsn�paramr^rrrr��s


z6ClientContextParamsDocumenter._add_context_params_listN)
rrhrir�ZOMITTED_CONTEXT_PARAMSr#r�r$rpr�rrrrr��s��
r�)rKZbotocorerZbotocore.compatrZbotocore.docs.bcdoc.restdocrZbotocore.docs.examplerZbotocore.docs.methodrrrZbotocore.docs.paramsr	Zbotocore.docs.sharedexampler
Zbotocore.docs.utilsrrrrrjr�rrrr�<module>
s0B