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/awscli/customizations/__pycache__/cliinputjson.cpython-36.opt-1.pyc
3

�T_+�@sTddlZddlmZmZddlmZddlmZdd�Zdd�Z	Gd	d
�d
e�Z
dS)�N)�
get_paramfile�LOCAL_PREFIX_MAP)�
ParamError)�OverrideRequiredArgsArgumentcCs|jdt�dS)Nzbuilding-argument-table)�register�add_cli_input_json)Zcli�r�"/usr/lib/python3.6/cliinputjson.py�register_cli_input_jsonsr
cKsd|krt|�}|j|�dS)NZoutfile)�CliInputJSONArgumentZadd_to_arg_table)�sessionZargument_table�kwargsZcli_input_json_argumentrrr	rsrcsFeZdZdZddd�Z�fdd�Z�fdd�Zd	d
�Zdd�Z�Z	S)
ra#This argument inputs a JSON string as the entire input for a command.

    Ideally, the value to this argument should be a filled out JSON file
    generated by ``--generate-cli-skeleton``. The items in the JSON string
    will not clobber other arguments entered into the command line.
    zcli-input-jsonakPerforms service operation based on the JSON string provided. The JSON string follows the format provided by ``--generate-cli-skeleton``. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.)�nameZ	help_textcstt|�j|�dS)N)�superr�__init__)�selfr)�	__class__rr	r2szCliInputJSONArgument.__init__cs"|jjd|j�tt|�j�dS)Nzcalling-command.*)Z_sessionr�add_to_call_parametersrr�_register_argument_action)r)rrr	r5s
z.CliInputJSONArgument._register_argument_actionc	Ks�t|dd�}|dk	r|t|t�}|dkr*|}ytj|�}Wn6tk
rn}zt|jd||f��WYdd}~XnX|j||�dS)NZcli_input_jsonz"Invalid JSON: %s
JSON received: %s)	�getattrrr�json�loads�
ValueErrorrr�_update_call_parameters)	r�call_parametersZparsed_argsZparsed_globalsr
Z
input_jsonZretrieved_json�
input_data�errr	r:s
z+CliInputJSONArgument.add_to_call_parameterscCs*x$|j�D]}||kr
||||<q
WdS)N)�keys)rrrZ	input_keyrrr	rPsz,CliInputJSONArgument._update_call_parameters)
�__name__�
__module__�__qualname__�__doc__ZARG_DATArrrr�
__classcell__rr)rr	r s	r)rZawscli.paramfilerrZawscli.argprocessrZawscli.customizations.argumentsrr
rrrrrr	�<module>
s