HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/__pycache__/generatecliskeleton.cpython-38.pyc
U

<�^��@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	�Zd
d�ZGdd
�d
e�ZGdd�de	�ZdS)�N)�
xform_name)�Stubber)�ArgumentGenerator)�CLIOperationCaller)�OverrideRequiredArgsArgument)�json_encodercCs|�dt�dS)Nzbuilding-argument-table)�register�add_generate_skeleton)Zcli�r
�K/usr/lib/python3/dist-packages/awscli/customizations/generatecliskeleton.py�register_generate_cli_skeletonsrcKs d|krt||�}|�|�dS)NZoutfile)�GenerateCliSkeletonArgumentZadd_to_arg_table)�session�operation_model�argument_table�kwargsZgenerate_cli_skeleton_argumentr
r
rr	s�r	csTeZdZdZddddddgd�Z�fdd	�Z�fd
d�Z�fdd
�Zdd�Z�Z	S)r
z�This argument writes a generated JSON skeleton to stdout

    The argument, if present in the command line, will prevent the intended
    command from taking place. Instead, it will generate a JSON skeleton and
    print it to standard output.
    zgenerate-cli-skeletonaJPrints a JSON skeleton to standard output without sending an API request. If provided with no value or the value ``input``, prints a sample input JSON that can be used as an argument for ``--cli-input-json``. If provided with the value ``output``, it validates the command inputs and returns a sample output JSON for that command.�?�input�output)�nameZ	help_text�nargsZconst�choicescstt|��|�||_dS)N)�superr
�__init__�_operation_model)�selfrr��	__class__r
rr<sz$GenerateCliSkeletonArgument.__init__cs"|j�d|j�tt|���dS)Nzcalling-command.*)�_sessionr�generate_json_skeletonrr
�_register_argument_action)rrr
rr @s
�z5GenerateCliSkeletonArgument._register_argument_actioncsfd|j}||krb|�|�}z||ddkr4WdSWntk
rJYnXtt|�j||f|�dS)Nz--�r)r�index�
IndexErrorrr
�override_required_args)rr�argsrZarg_nameZarg_locationrr
rr$Es



��z2GenerateCliSkeletonArgument.override_required_argscKs�t|dd�r�|jdk}|j}|rD|jj}|j}t|j��||||�St	�}	|j
}
|
dkr^i}n
|	�|
�}tj
�tj|dtd��tj
�d�dSdS)N�generate_cli_skeletonr�)�indent�default�
r)�getattrr&r�
service_model�service_namer�StubbedCLIOperationCallerrZinvokerZinput_shape�generate_skeleton�sys�stdout�write�json�dumpsr)rZcall_parametersZparsed_args�parsed_globalsrZ
for_outputrr-�operation_name�argument_generatorZoperation_input_shapeZskeletonr
r
rrUs0

���z2GenerateCliSkeletonArgument.generate_json_skeleton)
�__name__�
__module__�__qualname__�__doc__ZARG_DATArr r$r�
__classcell__r
r
rrr
&s�r
c@seZdZdZdd�ZdS)r.z�A stubbed CLIOperationCaller

    It generates a fake response and uses the response and provided parameters
    to make a stubbed client call for an operation command.
    c

Csrt|�}|jj�|�}i}|jr6tdd�}|�|j�}t|��*}	|	�||�t	||�f|�W5QR�SQRXdS)NT)Zuse_member_names)
r�metar,rZoutput_shaperr/rZadd_responser+)
rZclientr6Z
parametersr5Zmethod_namerZ
fake_responser7Zstubberr
r
r�_make_client_call{s�
�
z+StubbedCLIOperationCaller._make_client_callN)r8r9r:r;r>r
r
r
rr.usr.)r3r0ZbotocorerZ
botocore.stubrZbotocore.utilsrZawscli.clidriverrZawscli.customizations.argumentsrZawscli.utilsrrr	r
r.r
r
r
r�<module>
s	O