o
    .&ßay  ã                   @   s„   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 dd„ Z
d	d
„ Zdd„ Zdd„ Zdd„ Zdd„ ZG dd„ deƒZdS )aS  
This customization splits the modify-option-group into two separate commands:

* ``add-option-group``
* ``remove-option-group``

In both commands the ``--options-to-remove`` and ``--options-to-add`` args will
be renamed to just ``--options``.

All the remaining args will be available in both commands (which proxy
modify-option-group).

é    )ÚServiceOperation)ÚCLIOperationCaller)Úutils)ÚBasicCommand)Ú	uni_printc                 C   s(   |   dt¡ |   dt¡ |   dt¡ d S )Núbuilding-command-table.rdsz6building-argument-table.rds.add-option-to-option-groupz;building-argument-table.rds.remove-option-from-option-group)ÚregisterÚ_building_command_tableÚ_rename_add_optionÚ_rename_remove_option©Úcli© r   ú;/usr/lib/python3/dist-packages/awscli/customizations/rds.pyÚregister_rds_modify_split"   s   ÿÿr   c                 C   s   |   dt¡ d S )Nr   )r   Ú_add_generate_db_auth_tokenr   r   r   r   Ú#register_add_generate_db_auth_token*   s   r   c                 K   s   t |ƒ}|| d< d S )Núgenerate-db-auth-token)ÚGenerateDBAuthTokenCommand)Úcommand_tableÚsessionÚkwargsÚcommandr   r   r   r   .   s   r   c                 K   ó   t j| ddd� | d= d S )Núoptions-to-includeÚoptions©Únew_nameúoptions-to-remove©r   Úrename_argument©Úargument_tabler   r   r   r   r
   3   ó   ÿ
r
   c                 K   r   )Nr   r   r   r   r   r!   r   r   r   r   9   r#   r   c                 K   sR   | d= |  d¡}| d¡}tddt|ƒ||d�| d< tdd||t|ƒd�| d< d S )Nzmodify-option-groupÚrdsÚModifyOptionGroupzadd-option-to-option-group)Úparent_nameÚnameÚoperation_callerr   Úoperation_modelzremove-option-from-option-group)r&   r'   r   r)   r(   )Úget_service_modelr)   r   r   )r   r   r   Ú	rds_modelÚmodify_operation_modelr   r   r   r	   ?   s   


üür	   c                   @   s@   e Zd ZdZdZddddœdddd	d
œddddœgZdd„ ZdS )r   r   zEGenerates an auth token used to connect to a db with IAM credentials.ÚhostnameTz+The hostname of the database to connect to.)r'   ÚrequiredÚ	help_textÚportÚintegerz-The port number the database is listening on.)r'   Úcli_type_namer.   r/   ÚusernamezThe username to log in as.c                 C   sB   | j  d|j|j|j¡}|j|j|j|jd�}t	|ƒ t	dƒ dS )Nr$   )Ú
DBHostnameÚPortÚ
DBUsernameÚ
r   )
Ú_sessionÚcreate_clientÚregionÚendpoint_urlÚ
verify_sslÚgenerate_db_auth_tokenr-   r0   r3   r   )ÚselfÚparsed_argsÚparsed_globalsr$   Útokenr   r   r   Ú	_run_maina   s   
þýz$GenerateDBAuthTokenCommand._run_mainN)Ú__name__Ú
__module__Ú__qualname__ÚNAMEÚDESCRIPTIONÚ	ARG_TABLErB   r   r   r   r   r   S   s    ÿÿÿÿû	r   N)Ú__doc__Úawscli.clidriverr   r   Úawscli.customizationsr   Úawscli.customizations.commandsr   Úawscli.customizations.utilsr   r   r   r   r
   r   r	   r   r   r   r   r   Ú<module>   s   