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__/preview.cpython-36.opt-1.pyc
3

�T_E�@s`dZddlZddlZddlZeje�ZdgZdd�Zdd�Z	dd	�Z
d
d�ZGdd
�d
e�Z
dS)a:This module enables the preview-mode customization.

If a service is marked as being in preview mode, then any attempts
to call operations on that service will print a message pointing
the user to alternate solutions.  A user can still access this
service by enabling the service in their config file via:

    [preview]
    servicename=true

or by running:

    aws configure set preview.servicename true

Also any service that is marked as being in preview will *not*
be listed in the help docs, unless the service has been enabled
in the config file as shown above.

�NZsdbcCs|jdt�dS)Nzbuilding-command-table.main)�register�mark_as_preview)Zevents�r�/usr/lib/python3.6/preview.py�register_preview_commands-srcKs�t|�}xrtD]j}d}||kr.tjd|�d}||}tdt|jfi�}||j||jj	|d�||<|j
d�jd|t�qWdS)NFz/Preview service enabled through config file: %sTZPreviewCommand)Zcli_name�session�service_name�
is_enabledZ
event_emitterzdoc-description.%s)
�_get_allowed_services�PREVIEW_SERVICES�logger�debug�type�PreviewModeCommandMixin�	__class__�nameZ
service_modelrZ
get_componentZ
register_last�update_description_with_preview)Z
command_tabler�kwargsZallowed_servicesZpreview_servicer	Zoriginal_commandZpreview_clsrrrr1s&

rcKsV|jj}|j�|jtjj��|jjd�|jj	d�d}|j
d|�|j�dS)Nz(You can enable this service by running: �.rz!aws configure set preview.%s true)�doc�styleZ
start_noteZboldr�HELP_SNIPPET�strip�writeZevent_class�split�codeZend_note)Zhelp_commandrrrrrrrNsrcCs>g}|jjdi�}x&|j�D]\}}|dkr|j|�qW|S)N�preview�true)Zfull_config�get�items�append)rZallowedZpreview_servicesr�valuerrrr
esr
csFeZdZejd�ZdZ�fdd�Z�fdd�Zdd�Z	d	d
�Z
�ZS)ra    However, if you'd like to use the "aws {service}" commands with the
    AWS CLI, you can enable this service by adding the following to your CLI
    config file:

        [preview]
        {service}=true

    or by running:

        aws configure set preview.{service} true

    zGAWS CLI support for this service is only available in a preview stage.
cs"|jd�|_tt|�j||�dS)Nr	)�pop�_is_enabled�superr�__init__)�self�argsr)rrrr%�sz PreviewModeCommandMixin.__init__cs.|js|j|�r"tt|�j||�S|j�SdS)N)r#�_is_help_commandr$r�__call__�_display_opt_in_message)r&r'Zparsed_globals)rrrr)�s
z PreviewModeCommandMixin.__call__cCs|o|ddkS)N��help���r)r&r'rrrr(�sz(PreviewModeCommandMixin._is_help_commandcCs6tjj|j�tjjd�tjj|jj|jd��dS)N�
)Zservicer+)�sys�stderrrr�ENABLE_DOCS�formatZ
_service_name)r&rrrr*�sz/PreviewModeCommandMixin._display_opt_in_message)�__name__�
__module__�__qualname__�textwrap�dedentr1rr%r)r(r*�
__classcell__rr)rrrqsr)�__doc__Zloggingr/r6Z	getLoggerr3rrrrrr
�objectrrrrr�<module>s