HEX
Server: Apache
System: Linux aura.ambarhosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User: chicagos (1295)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/awscli/schema.pyc
�
R$�_c@sVddlmZdefd��YZdefd��YZdefd��YZdS(	i����(tdefaultdicttParameterRequiredErrorcBseZRS((t__name__t
__module__(((s1/usr/lib/python2.7/site-packages/awscli/schema.pyRstSchemaTransformercBsseZdZidd6dd6Zd�Zd�Zd�Zd�Zd	�Zd
�Z	d�Z
d�Zd
�ZRS(sE
    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

    t	structuretobjecttlisttarraycCst�|_dS(N(tShapeNameGeneratort_shape_namer(tself((s1/usr/lib/python2.7/site-packages/awscli/schema.pyt__init__GscCsi}|j||d�|S(s�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.

        t
InputShape(t
_transform(Rtschematshapes((s1/usr/lib/python2.7/site-packages/awscli/schema.pyt	transformJscCs�d|krtd��n|ddkrD|j||�||<ne|ddkrm|j||�||<n<|ddkr�|j||�||<n|j|�||<|S(NttypesMissing required key: 'type'RRtmap(Rt_transform_structuret_transform_listt_transform_mapt_transform_scalar(RRRt
shape_name((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR\scCs
|j|�S(N(t_populate_initial_shape(RR((s1/usr/lib/python2.7/site-packages/awscli/schema.pyRisc
Cs�|j|�}i}g}x�|dj�D]s\}}|j|�}|jj|�}	i|	d6||<|jdt�r�|j|�n|j|||	�q,W||d<|r�||d<n|S(Nt
propertiestshapetrequiredtmembers(	Rtitemst_json_schema_to_aws_typeR
tnew_shape_nametgettFalsetappendR(
RRRtstructure_shapeRtrequired_memberstkeytvaluetcurrent_type_nametcurrent_shape_name((s1/usr/lib/python2.7/site-packages/awscli/schema.pyRls		

cCsw|j|�}xaddgD]S}|j||�}|jj|�}i|d6||<|j||||�qW|S(NR&R'R(RRR
R R(RRRR$t	attributet	type_nameR((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR�scCs`|j|�}|j|d�}|jj|�}i|d6|d<|j|d||�|S(NRRtmember(RRR
R R(RRRt
list_shapetmember_typetmember_shape_name((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR�scCsTi|j|�d6}d|kr3|d|d<nd|krP|d|d<n|S(NRtdescriptiont
documentationtenum(R(RRR((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR�scCs8d|krtd��n|d}|jj||�S(NRsMissing required key: 'type'(RtJSON_SCHEMA_TO_AWS_TYPESR!(RRR+((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR�s
(
RRt__doc__R3RRRRRRRRR(((s1/usr/lib/python2.7/site-packages/awscli/schema.pyRs-
			
						R	cBseZd�Zd�ZRS(cCstt�|_dS(N(Rtintt_name_cache(R((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR�scCs4|j|cd7<|j|}d|j�|fS(Nis%sType%s(R6t
capitalize(RR+t
current_index((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR �s
(RRRR (((s1/usr/lib/python2.7/site-packages/awscli/schema.pyR	�s	N(tcollectionsRt
ValueErrorRRRR	(((s1/usr/lib/python2.7/site-packages/awscli/schema.pyt<module>
s�