HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/botocore/docs/__pycache__/utils.cpython-36.pyc
3

�T_�@s�ddlZddlmZdd�Zdd�Zdd�Zed	d
ddd
ddg�ZGdd	�d	e�ZGdd�de�Z	Gdd�de�Z
Gdd�de�Zdddddd�Zej
djeeje���Zdd�Zd d!�ZdS)"�N)�
namedtuplecCsdddddddd�j||�S)z�Get the Python type name for a given model type.

        >>> py_type_name('list')
        'list'
        >>> py_type_name('structure')
        'dict'

    :rtype: string
    �bytes�string�float�integer�dictZdatetime)�blob�	character�double�long�map�	structure�	timestamp)�get)�	type_name�r�/usr/lib/python3.6/utils.py�py_type_namesrcCs"ddddddddddd	�
j|d
�S)z�Get the Python default value for a given model type.

        >>> py_default('string')
        ''string''
        >>> py_default('list')
        '[...]'
        >>> py_default('unknown')
        '...'

    :rtype: string
    z123.0Z123z'string'zb'bytes'z
True|Falsez[...]z{...}zdatetime(2015, 1, 1))
r
rrrrZboolean�listrr
rz...)r)rrrr�
py_default&s
rcCsl|jjd�}|jjdd�}|jd�r0|dd�}|jd�rF|dd�}|rh|j�|j�krh|d	j|�7}|S)
zwGenerate the official name of an AWS Service

    :param service_model: The service model representing the service
    ZserviceFullNameZserviceAbbreviation�ZAmazon�NZAWS�z ({0}))�metadatar�
startswith�lower�format)Z
service_modelZ
official_nameZ
short_namerrr�get_official_service_name@s

r�DocumentedShape�namer�
documentationr�members�required_memberscs"eZdZdZd�fdd�	Z�ZS)rzBUse this class to inject new shapes into a model for documentationNcs@|dkrg}|dkrg}|dkr$g}tt|�j|||||||�S)N)�superr�__new__)�clsrrr rr!r")�	__class__rrr$Ws
zDocumentedShape.__new__)NNN)�__name__�
__module__�__qualname__�__doc__r$�
__classcell__rr)r&rrUsc@seZdZddd�Zdd�ZdS)�AutoPopulatedParamNcCs||_||_|dkrd|_dS)Nz{Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
)r�param_description)�selfrr-rrr�__init__eszAutoPopulatedParam.__init__cKs~|jd�rN|j|jkrz|j|j�}d|jkr6|jd�|jd�}|j|j�n,|jd�rz|jd�}|j|jkrz|j|j�dS)z�Documents auto populated parameters

        It will remove any required marks for the parameter, remove the
        parameter from the example, and add a snippet about the parameter
        being autopopulated in the description.
        zdocs.request-paramszis-requiredzparam-documentationzdocs.request-examplezstructure-valueN)rr�available_sections�get_section�delete_section�writelnr-)r.�
event_name�section�kwargs�description_sectionrrr�document_auto_populated_paramns




z0AutoPopulatedParam.document_auto_populated_param)N)r'r(r)r/r8rrrrr,ds
	r,c@s eZdZdZdd�Zdd�ZdS)�HideParamFromOperationsa>Hides a single parameter from multiple operations.

    This method will remove a parameter from documentation and from
    examples. This method is typically used for things that are
    automatically populated because a user would be unable to provide
    a value (e.g., a checksum of a serialized XML request body).cCsX||_t�|_t�|_d}d}x4|D],}|jj|||f�|jj|||f�q$WdS)a(
        :type service_name: str
        :param service_name: Name of the service to modify.

        :type parameter_name: str
        :param parameter_name: Name of the parameter to modify.

        :type operation_names: list
        :param operation_names: Operation names to modify.
        z*docs.request-params.%s.%s.complete-sectionz+docs.request-example.%s.%s.complete-sectionN)�_parameter_name�set�_params_events�_example_events�add)r.Zservice_name�parameter_nameZoperation_namesZparam_templateZexample_templaterrrrr/�s
z HideParamFromOperations.__init__cKs@||jkr|jd�}n||jkr$dS|j|jkr<|j|j�dS)Nzstructure-value)r=r1r<r:r0r2)r.r4r5r6rrr�
hide_param�s

z"HideParamFromOperations.hide_paramN)r'r(r)r*r/r@rrrrr9�sr9c@s eZdZdZdd�Zdd�ZdS)�AppendParamDocumentationz-Appends documentation to a specific parametercCs||_||_dS)N)r:�_doc_string)r.r?Z
doc_stringrrrr/�sz!AppendParamDocumentation.__init__cKs2|j|jkr.|j|j�}|jd�}|j|j�dS)Nzparam-documentation)r:r0r1r3rB)r.r4r5r6r7rrr�append_documentation�s
z-AppendParamDocumentation.append_documentationN)r'r(r)r*r/rCrrrrrA�srAz\nz\rz\tz\bz\f)�
�
�	���|cCst|jd�S)Nr)�	_CONTROLS�group)�matchrrr�<lambda>�srMcCstjt|�S)N)�_ESCAPE_CONTROLS_RE�sub�_CONTROLS_MATCH_HANDLER)�valuerrr�escape_controls�srR)�re�collectionsrrrrZ_DocumentedShaper�objectr,r9rArJ�compile�joinr�escaperNrPrRrrrr�<module>
s&

&