HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/__pycache__/generatecliskeleton.cpython-310.pyc
o

.&�a��@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)�cli�r�K/usr/lib/python3/dist-packages/awscli/customizations/generatecliskeleton.py�register_generate_cli_skeletonsr
cKs$d|vrt||�}|�|�dSdS)N�outfile)�GenerateCliSkeletonArgument�add_to_arg_table)�session�operation_model�argument_table�kwargs�generate_cli_skeleton_argumentrrrr	s��r	csTeZdZdZddddddgd�Z�fdd	�Z�fd
d�Z�fdd
�Zdd�Z�Z	S)rz�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)�name�	help_text�nargs�const�choicescstt|��|�||_dS)N)�superr�__init__�_operation_model)�selfrr��	__class__rrr<s
z$GenerateCliSkeletonArgument.__init__cs"|j�d|j�tt|���dS)Nzcalling-command.*)�_sessionr�generate_json_skeletonrr�_register_argument_action)r!r"rrr&@s�z5GenerateCliSkeletonArgument._register_argument_actioncsld|j}||vr4|�|�}z
||ddkrWdSWn	ty$Ynwtt|�j||fi|��dSdS)Nz--�r)r�index�
IndexErrorrr�override_required_args)r!r�argsr�arg_name�arg_locationr"rrr*Es 

��
�
��z2GenerateCliSkeletonArgument.override_required_argscKs�t|dd�rH|jdk}|j}|r"|jj}|j}t|j��||||�St	�}	|j
}
|
dur/i}n|	�|
�}tj
�tj|dtd��tj
�d�dSdS)N�generate_cli_skeletonr�)�indent�default�
r)�getattrr.r �
service_model�service_namer�StubbedCLIOperationCallerr$�invoker�input_shape�generate_skeleton�sys�stdout�write�json�dumpsr)r!�call_parameters�parsed_args�parsed_globalsr�
for_outputrr5�operation_name�argument_generator�operation_input_shape�skeletonrrrr%Us.

����z2GenerateCliSkeletonArgument.generate_json_skeleton)
�__name__�
__module__�__qualname__�__doc__�ARG_DATArr&r*r%�
__classcell__rrr"rr&s�rc@seZdZdZdd�ZdS)r6z�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
Cs�t|�}|jj�|�}i}|jrtdd�}|�|j�}t|��}	|	�||�t	||�di|��Wd�S1s:wYdS)NT)�use_member_namesr)
r�metar4r�output_shaperr9r�add_responser3)
r!�clientrC�
parametersrA�method_namer�
fake_responserD�stubberrrr�_make_client_call{s�
�
$�z+StubbedCLIOperationCaller._make_client_callN)rGrHrIrJrVrrrrr6usr6)r=r:�botocorer�
botocore.stubr�botocore.utilsr�awscli.clidriverr�awscli.customizations.argumentsr�awscli.utilsrr
r	rr6rrrr�<module>s	O