HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/botocore/docs/__pycache__/client.cpython-37.pyc
B

�P�e�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�E/opt/alt/python37/lib/python3.7/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�}|�|�S)N)rr�_filter_client_methods)rr)rrrr%<s
z$ClientDocumenter._get_client_methodscCs<i}x2|��D]&\}}|j|||jd�}|r|||<qW|S)N)�methodrr)�items�_filter_client_methodr)rr)Zfiltered_methodsrr,�includerrrr+@s
z'ClientDocumenter._filter_client_methodscKs*x$|jD]}|f|�}|dk	r|SqWdS)NT)�_CLIENT_METHODS_FILTERS)rr�filterZfilter_includerrrr.Ls

z&ClientDocumenter._filter_client_methodcCs|j�d�dS)NZClient)�style�h2)rr(rrrr#VszClientDocumenter._add_titlecCs�|�d�}t|jjj�}|�d|���|j��|�|jjjj	�|�
|�|j��|j��|�
d�|j��x(t|�D]}|j�|j�d|���q�WdS)NZintroz A low-level client representing z These are the available methods:z/client/)�add_new_sectionrrrr�writer2�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)r2�start_sphinx_py_classr)rr(rrrr$rsz%ClientDocumenter._add_class_signaturecCs6|j��|j��|�dj|jd��|j��dS)Nz+client = session.create_client('{service}'))Zservice)r2�start_codeblockr6r5�formatr�
end_codeblock)rr(rrrr9ws

z-ClientDocumenter._add_client_creation_examplecCsTxNt|�D]B}t|dd�}|�||||�tj�|j|jd�}|�||�q
WdS)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)
r4r2�refrrr5�add_title_section�_is_custom_method�_add_custom_method�_add_model_driven_method)rr(rr,�breadcrumb_sectionZmethod_sectionrrrrG�s


z#ClientDocumenter._add_client_methodcCs||jjjkS)N)rr�method_to_api_mapping)rrrrrrQ�sz"ClientDocumenter._is_custom_methodcCst|||�dS)N)r)rr(rr,rrrrR�sz#ClientDocumenter._add_custom_methodcCs`|�d�}|j��|j�d�|j��x0|jD]&}|j�d|j��}|j�d|�q2WdS)N�
exceptionsZ
Exceptionsz.Client.exceptions.z:py:class:`%s`)r4r2r6�bold�error_shapesr�nameZli)rr(�operation_modelZ
error_section�errorr@rrr�_add_method_exceptions_list�s


z,ClientDocumenter._add_method_exceptions_listc	Cs�|jjj}|jjj|}|�|�}d|}|j�dd��|��}t||||jjj|j	|d�|j
rn|�||�|j�|�}|r�t
||||�dS)Nzresponse = client.%srM�)�
event_emitterZmethod_description�example_prefix)rrrrUrZrN�getr�eventsr8rXr\rr
)	rr(rr�operation_namerZr_Zfull_method_namer!rrrrS�s$

z)ClientDocumenter._add_model_driven_method)N)r�
__module__�__qualname__rr0r"r*r%r+r.r#r&r$r9r'rGrQrRr\rSrrrrr#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.)rY�	type_namer8�Messagez;A descriptive message explaining why the exception occured.)rYrhr8�memberscCs*||_|jjj|_|jjjj|_||_dS)N)	rrrrrrrrr)rrr rrrr"�sz#ClientExceptionsDocumenter.__init__cCs*|�|�|�|�|�|�|��dS)N)r#�
_add_overview�_add_exceptions_list�_add_exception_classes)rr(rrr�document_exceptions�s


z.ClientExceptionsDocumenter.document_exceptionscCs|j�d�dS)NzClient Exceptions)r2r3)rr(rrrr#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�.)r2r6r5�
external_link�_USER_GUIDE_LINK)rr(rrrrks


z(ClientExceptionsDocumenter._add_overviewcCs|j�d|j��S)Nz.Client.exceptions.)rrY)r�shaperrr�_exception_class_namesz0ClientExceptionsDocumenter._exception_class_namecCs||jjjj}|s2|j��|�d�|j��dS|j��|�d�|j��x&|D]}|j�	|j
�d|j���qVWdS)Nz-This client has no modeled exception classes.z$The available client exceptions are:z/client/exceptions/)rrrrXr2r6r5r<r=r?rrY)rr(rXrtrrrrls






z/ClientExceptionsDocumenter._add_exceptions_listcCsXxR|jjjjD]B}t|jdd�}|�||�tj�	|j
|jdd�}|�||j�qWdS)NrE)rFrrV)
rrrrXrrY�_add_exception_classrHrIrJrrrK)rrtZexception_doc_structureZexception_dir_pathrrrrm(sz1ClientExceptionsDocumenter._add_exception_classescCs�|�d�}|j�|jd|j���|�d|j���|�|j�|�|j�}|�|�}|jj	|d�|�
||�|�||�|�||�|j�
�dS)NrLz	../../../z / Client / exceptions / )r@)r4r2rOrrr5rYrPrurA�_add_top_level_documentation�_add_exception_catch_example�_add_response_attrZend_sphinx_py_class)rr(rtrTZ
class_sectionr@rrrrv;s

z/ClientExceptionsDocumenter._add_exception_classcCs*|jr&|j��|�|j�|j��dS)N)r8r2r6r7)rr(rtrrrrwJs
z7ClientExceptionsDocumenter._add_top_level_documentationcCs�|j��|j�d�|j��|j��|�d�|j��|j��|�d�|j��|j��|�d|j�|j��|j��|�d�|j��|j�	�dS)NZExampleztry:z...z!except client.exceptions.%s as e:zprint(e.response))
r2r6rWr;rBr5�indentr:rYrD)rr(rtrrrrxPs 












z7ClientExceptionsDocumenter._add_exception_catch_examplecCsF|�d�}|j�d�|�|�|�||�|�||�|j��dS)N�response)r4r2Zstart_sphinx_py_attr�_add_response_attr_description�_add_response_example�_add_response_paramsZend_sphinx_py_attr)rr(rtZresponse_sectionrrrrybs

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.)r2r6r7)rr(rrrr|js
z9ClientExceptionsDocumenter._add_response_attr_descriptioncCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)N�syntax�Syntax)rrbr^)r/)r4r2r6rWr;rrrrraZdocument_example�_GENERIC_ERROR_SHAPE)rr(rtZexample_section�
documenterrrrr}ts


z0ClientExceptionsDocumenter._add_response_examplecCsX|�d�}|j��|j�d�|j��t|jd|jjj	d�}|j
|||jgd�dS)NZ	Structure)rrbr^)r/)r4r2r6rWr;r	rrrraZdocument_paramsr�)rr(rtZparams_sectionr�rrrr~�s


z/ClientExceptionsDocumenter._add_response_paramsN)rrcrdrsrrr�r"rnr#rkrurlrmrvrwrxryr|r}r~rrrrre�s<	
rec@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||_||_dS)N)r�_context_params)rrZcontext_paramsrrrr"�sz&ClientContextParamsDocumenter.__init__cCs"|�|�|�|�|�|�dS)N)r#rk�_add_context_params_list)rr(rrr�document_context_params�s

z5ClientContextParamsDocumenter.document_context_paramscCs|j�d�dS)NzClient Context Parameters)r2r3)rr(rrrr#�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 guide)rorprq)r2r6r5rr�_CONFIG_GUIDE_LINK)rr(rrrrk�s


z+ClientContextParamsDocumenter._add_overviewc	Csz|j��d|j�d�}|�d|�d��xJ|jD]@}|j��dt|j��d�}|�d|�d|j�d|j	���q2WdS)Nz``zThe available z client context params are:z* z (z) - )
r2r6rr<r�rrYr5�typer8)rr(Zsn�paramrYrrrr��s

z6ClientContextParamsDocumenter._add_context_params_listN)
rrcrdr�ZOMITTED_CONTEXT_PARAMSr"r�r#rkr�rrrrr��sr�)rHZbotocorerZbotocore.compatrZbotocore.docs.bcdoc.restdocrZbotocore.docs.examplerZbotocore.docs.methodrrrZbotocore.docs.paramsr	Zbotocore.docs.sharedexampler
Zbotocore.docs.utilsrrrrrer�rrrr�<module>
s2B