HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib64/python3.10/site-packages/botocore/docs/__pycache__/client.cpython-310.pyc
o

�h�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|dkrdS|dvS)N�generate_presigned_url)�s3�)�method_name�service_name�kwargsrr�G/usr/local/CyberCP/lib/python3.10/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|_||_||_|jduri|_|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)r r+rrrr'<s

z$ClientDocumenter._get_client_methodscCs8i}|��D]\}}|j|||jd�}|r|||<q|S)N)�methodrr)�items�_filter_client_methodr)r r+�filtered_methodsrr.�includerrrr-@s��z'ClientDocumenter._filter_client_methodscKs.|jD]}|di|��}|dur|SqdS)NTr)�_CLIENT_METHODS_FILTERS)r r�filter�filter_includerrrr0Ls
�z&ClientDocumenter._filter_client_methodcC�|j�d�dS)N�Client��style�h2�r r*rrrr%V�zClientDocumenter._add_titlecCs�|�d�}t|jjj�}|�d|���|j��|�|jjjj	�|�
|�|j��|j��|�
d�|j��t|�D]}|j�|j�d|���q?dS)N�introz A low-level client representing z These are the available methods:z/client/)�add_new_sectionrrrr�writer9�new_line�include_doc_string�
documentation�_add_client_creation_example�dedent�
new_paragraph�writeln�toctree�sorted�tocitemr)r r*r+�official_service_namerrrrr(Ys&
��

�




�z"ClientDocumenter._add_client_introcCs|jj|j�d�d�dS)Nz.Client��
class_name)r9�start_sphinx_py_classrr;rrrr&rs

�z%ClientDocumenter._add_class_signaturecCs6|j��|j��|�d|j�d��|j��dS)Nz client = session.create_client('z'))r9�start_codeblockr@r?r�
end_codeblockr;rrrrCws

�z-ClientDocumenter._add_client_creation_examplecCsPt|�D]!}t|dd�}|�||||�tj�|j|jd�}|�||�qdS)N�html��targetr!)	rHr�_add_client_method�os�path�joinrr�
write_to_file)r r+r�method_doc_structure�client_dir_pathrrrr)s�
�
��z$ClientDocumenter._add_client_methodscCs�|�d�}|j�|jd|j���|�d|���|�|�|j|d|j�d�id�}|�|�r9|�|||�dS|�	||�dS)N�
breadcrumbz../../z / Client / �	qualifierz.Client.)�context)
r>r9�refrrr?�add_title_section�_is_custom_method�_add_custom_method�_add_model_driven_method)r r*rr.�breadcrumb_section�method_sectionrrrrS�s"
�
�
�z#ClientDocumenter._add_client_methodcCs||jjjvSr)rr�method_to_api_mapping)r rrrrr_�sz"ClientDocumenter._is_custom_methodcCst|||�dSr)r)r r*rr.rrrr`�r<z#ClientDocumenter._add_custom_methodcCs`|�d�}|j��|j�d�|j��|jD]}|j�d|j��}|j�d|�d��qdS)N�
exceptions�
Exceptions�.Client.exceptions.z:py:class:`�`)r>r9r@�bold�error_shapesr�name�li)r r*�operation_model�
error_section�errorrLrrr�_add_method_exceptions_list�s



��z,ClientDocumenter._add_method_exceptions_listc	Cs�|jjj}|jjj|}|�|�}d|��}|j�dd��|��}t||||jjj|j	|d�|j
r8|�||�|j�|�}|rIt
||||�dSdS)Nzresponse = client.r[�)�
event_emitter�method_description�example_prefix)rrrrdrmr\�getr�eventsrBrjrprr
)	r r*rr�operation_namermrt�full_method_namer#rrrra�s,


��
��z)ClientDocumenter._add_model_driven_methodr)r�
__module__�__qualname__rr3r$r,r'r-r0r%r(r&rCr)rSr_r`rprarrrrr#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�Error�	structurez1Normalized access to common exception attributes.�Code�stringz,An identifier specifying the exception type.)rk�	type_namerB�Messagez;A descriptive message explaining why the exception occured.)rkr�rB�memberscCs*||_|jjj|_|jjjj|_||_dSr)	rrrrrrrrr)r r!r"rrrr$�s
z#ClientExceptionsDocumenter.__init__cCs*|�|�|�|�|�|�|��dSr)r%�
_add_overview�_add_exceptions_list�_add_exception_classesr;rrr�document_exceptions�s


z.ClientExceptionsDocumenter.document_exceptionscCr6)NzClient Exceptionsr8r;rrrr%r<z%ClientExceptionsDocumenter._add_titlecC�>|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�.)r9r@r?�
external_link�_USER_GUIDE_LINKr;rrrr��
��
z(ClientExceptionsDocumenter._add_overviewcCs|j�d|j��S)Nrg)rrk)r �shaperrr�_exception_class_namesz0ClientExceptionsDocumenter._exception_class_namecCsx|jjjj}|s|j��|�d�|j��dS|j��|�d�|j��|D]}|j�	|j
�d|j���q*dS)Nz-This client has no modeled exception classes.z$The available client exceptions are:z/client/exceptions/)rrrrjr9r@r?rFrGrIrrk)r r*rjr�rrrr�s





��z/ClientExceptionsDocumenter._add_exceptions_listcCsT|jjjjD]!}t|jdd�}|�||�tj�	|j
|jdd�}|�||j�qdS)NrPrQr!re)
rrrrjrrk�_add_exception_classrTrUrVrrrW)r r��exception_doc_structure�exception_dir_pathrrrr�&s����z1ClientExceptionsDocumenter._add_exception_classescCs�|�d�}|j�|jd|j���|�d|j���|�|j�|�|j�}|�|�}|jj	|d�|�
||�|�||�|�||�|j�
�dS)NrZz	../../../z / Client / exceptions / rK)r>r9r]rrr?rkr^r�rM�_add_top_level_documentation�_add_exception_catch_example�_add_response_attr�end_sphinx_py_class)r r*r�rb�
class_sectionrLrrrr�9s
�
z/ClientExceptionsDocumenter._add_exception_classcCs.|jr|j��|�|j�|j��dSdSr)rBr9r@rA�r r*r�rrrr�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)N�Exampleztry:z...zexcept client.exceptions.z as e:zprint(e.response))
r9r@rirErNr?�indentrDrkrOr�rrrr�Ns 












z7ClientExceptionsDocumenter._add_exception_catch_examplecCsF|�d�}|j�d�|�|�|�||�|�||�|j��dS)N�response)r>r9�start_sphinx_py_attr�_add_response_attr_description�_add_response_example�_add_response_params�end_sphinx_py_attr)r r*r��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.)r9r@rAr;rrrr�hs

�z9ClientExceptionsDocumenter._add_response_attr_descriptioncCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)N�syntax�Syntax�rrwrr�r2)r>r9r@rirErrrrrv�document_example�_GENERIC_ERROR_SHAPE)r r*r��example_section�
documenterrrrr�r�


�
�z0ClientExceptionsDocumenter._add_response_examplecCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)N�	Structurer�r�)r>r9r@rirEr	rrrrv�document_paramsr�)r r*r��params_sectionr�rrrr��r�z/ClientExceptionsDocumenter._add_response_paramsN)rryrzr�rrr�r$r�r%r�r�r�r�r�r�r�r�r�r�r�rrrrr{�sN��������
r{c@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ClientContextParamsDocumenterzPhttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html)�
Accelerate�DisableMultiRegionAccessPoints�ForcePathStyle�UseArnRegion)r�)r�	s3controlcCs||_||_dSr)r�_context_params)r r�context_paramsrrrr$�s
z&ClientContextParamsDocumenter.__init__cCs"|�|�|�|�|�|�dSr)r%r��_add_context_params_listr;rrr�document_context_params�s

z5ClientContextParamsDocumenter.document_context_paramscCr6)NzClient Context Parametersr8r;rrrr%�r<z(ClientContextParamsDocumenter._add_titlecCr�)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�)r9r@r?r��_CONFIG_GUIDE_LINKr;rrrr��r�z+ClientContextParamsDocumenter._add_overviewc	Csv|j��d|j�d�}|�d|�d��|jD] }|j��dt|j��d�}|�d|�d|j�d|j	���qdS)Nz``zThe available z client context params are:z* z (z) - )
r9r@rrFr�rrkr?�typerB)r r*�sn�paramrkrrrr��s


"�z6ClientContextParamsDocumenter._add_context_params_listN)
rryrzr��OMITTED_CONTEXT_PARAMSr$r�r%r�r�rrrrr��s��
r�)rT�botocorer�botocore.compatr�botocore.docs.bcdoc.restdocr�botocore.docs.exampler�botocore.docs.methodrrr�botocore.docs.paramsr	�botocore.docs.sharedexampler
�botocore.docs.utilsrrrrr{r�rrrr�<module>s0B