o
    !d                     @   sD   d dl mZ d dl mZ d dl mZ d dlmZ G dd deZdS )    )emrutils)
exceptions)helptext)Commandc                
   @   sh   e Zd ZdZdZddejddddd	ejd
dddd	ejd
dddddd
dddddd
gZdd Z	dS )ModifyClusterAttrzmodify-cluster-attributeszSModifies the cluster attributes 'visible-to-all-users' and 'termination-protected'.z
cluster-idT)namerequired	help_textzvisible-to-all-usersF
store_truevisible)r   r   actionZ
group_namer	   zno-visible-to-all-usersztermination-protected	terminatez$Set termination protection on or offzno-termination-protectedc                 C   s   |j r|jrtjddd|jr|jrtjddd|js*|js*|j s*|js*t |j s0|jrG|j o6|j }|jg|d}t	| j
d|| |jsM|jrd|joS|j }|jg|d}t	| j
d	|| d
S )Nz--visible-to-all-usersz--no-visible-to-all-users)Zoption1Zoption2z--termination-protectedz--no-termination-protected)
JobFlowIdsZVisibleToAllUsersZSetVisibleToAllUsers)r   ZTerminationProtectedZSetTerminationProtectionr   )Zvisible_to_all_usersZno_visible_to_all_usersr   ZMutualExclusiveOptionErrorZtermination_protectedZno_termination_protectedZMissingClusterAttributesErrorZ
cluster_idr   Zcall_and_display_responseZ_session)selfargsZparsed_globalsr   
parametersZ	protected r   Uusr/lib/python3.10/site-packages/awscli/customizations/emr/modifyclusterattributes.py_run_main_command)   sN   z#ModifyClusterAttr._run_main_commandN)
__name__
__module____qualname__NAMEZDESCRIPTIONr   Z
CLUSTER_IDZ
VISIBILITYZ	ARG_TABLEr   r   r   r   r   r      s0    r   N)Zawscli.customizations.emrr   r   r   Z!awscli.customizations.emr.commandr   r   r   r   r   r   <module>   s
   