https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/awscli/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/awscli/__pycache__/schema.cpython-310.pyc
o

2&�a��@s@ddlmZGdd�de�ZGdd�de�ZGdd�de�ZdS)	�)�defaultdictc@seZdZdS)�ParameterRequiredErrorN)�__name__�
__module__�__qualname__�rr�//usr/lib/python3/dist-packages/awscli/schema.pyrsrc@sbeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�SchemaTransformeraE
    Transforms a custom argument parameter schema into an internal
    model representation so that it can be treated like a normal
    service model. This includes shorthand JSON parsing and
    automatic documentation generation. The format of the schema
    follows JSON Schema, which can be found here:

    http://json-schema.org/

    Only a relevant subset of features is supported here:

    * Types: `object`, `array`, `string`, `integer`, `boolean`
    * Properties: `type`, `description`, `required`, `enum`

    For example::

    {
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "arg1": {
                    "type": "string",
                    "required": True,
                    "enum": [
                        "Value1",
                        "Value2",
                        "Value3"
                    ]
                },
                "arg2": {
                    "type": "integer",
                    "description": "The number of calls"
                }
            }
        }
    }

    Assuming the schema is applied to a service named `foo`, with an
    operation named `bar` and that the parameter is called `baz`, you
    could call it with the shorthand JSON like so::

        $ aws foo bar --baz arg1=Value1,arg2=5 arg1=Value2

    �	structure�list)�object�arraycCst�|_dS�N)�ShapeNameGenerator�_shape_namer��selfrrr�__init__GszSchemaTransformer.__init__cCsi}|�||d�|S)a�Convert JSON schema to the format used internally by the AWS CLI.

        :type schema: dict
        :param schema: The JSON schema describing the argument model.

        :rtype: dict
        :return: The transformed model in a form that can be consumed
            internally by the AWS CLI.  The dictionary returned will
            have a list of shapes, where the shape representing the
            transformed schema is always named ``InputShape`` in the
            returned dictionary.

        �
InputShape)�
_transform)r�schema�shapesrrr�	transformJszSchemaTransformer.transformcCs�d|vrtd��|ddkr|�||�||<|S|ddkr(|�||�||<|S|ddkr8|�||�||<|S|�|�||<|S)N�type�Missing required key: 'type'rr
�map)r�_transform_structure�_transform_list�_transform_map�_transform_scalar)rrr�
shape_namerrrr\s���zSchemaTransformer._transformcCs
|�|�Sr)�_populate_initial_shape)rrrrrris
z#SchemaTransformer._transform_scalarc
Cs�|�|�}i}g}|d��D]'\}}|�|�}|j�|�}	d|	i||<|�dd�r/|�|�|�|||	�q||d<|rA||d<|S)N�
properties�shape�requiredF�members)r!�items�_json_schema_to_aws_typer�new_shape_name�get�appendr)
rrr�structure_shaper%�required_members�key�value�current_type_name�current_shape_namerrrrls 

�
z&SchemaTransformer._transform_structurecCsP|�|�}dD]}|�||�}|j�|�}d|i||<|�||||�q|S)N)r-r.r#�r!r'rr(r)rrrr+�	attribute�	type_namer rrrr�s
z SchemaTransformer._transform_mapcCsF|�|�}|�|d�}|j�|�}d|i|d<|�|d||�|S)Nr&r#�memberr1)rrr�
list_shape�member_type�member_shape_namerrrr�s
z!SchemaTransformer._transform_listcCs:d|�|�i}d|vr|d|d<d|vr|d|d<|S)Nr�description�
documentation�enum)r')rrr#rrrr!�sz)SchemaTransformer._populate_initial_shapecCs&d|vrtd��|d}|j�||�S)Nrr)r�JSON_SCHEMA_TO_AWS_TYPESr))rrr3rrrr'�sz*SchemaTransformer._json_schema_to_aws_typeN)rrr�__doc__r;rrrrrrrr!r'rrrrr	s.�
	r	c@seZdZdd�Zdd�ZdS)rcCstt�|_dSr)r�int�_name_cacherrrrr�szShapeNameGenerator.__init__cCs,|j|d7<|j|}d|��|fS)N�z%sType%s)r>�
capitalize)rr3�
current_indexrrrr(�s
z!ShapeNameGenerator.new_shape_nameN)rrrrr(rrrrr�srN)�collectionsr�
ValueErrorrrr	rrrrr�<module>s


https://t.me/RX1948 - 2025