o
    !d                     @   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.10/site-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   Zrename_argumentZ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rdsZModifyOptionGroupzadd-option-to-option-group)parent_namenameoperation_callerr   operation_modelzremove-option-from-option-group)r#   r$   r   r&   r%   )Zget_service_modelr&   r   r   )r   r   r   Z	rds_modelZ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$   Zcli_type_namer(   r)   usernamezThe username to log in as.c                 C   sD   | j jd|j|j|jd}|j|j|j|jd}t	| t	d dS )Nr"   )Zregion_nameendpoint_urlZverify)Z
DBHostnameZPortZ
DBUsername
r   )
Z_sessionZcreate_clientZregionr-   Z
verify_sslZgenerate_db_auth_tokenr'   r*   r,   r   )selfZparsed_argsZparsed_globalsr"   tokenr   r   r   	_run_maina   s   z$GenerateDBAuthTokenCommand._run_mainN)__name__
__module____qualname__NAMEZDESCRIPTIONZ	ARG_TABLEr1   r   r   r   r   r   S   s    	r   N)__doc__Zawscli.clidriverr   r   Zawscli.customizationsr   Zawscli.customizations.commandsr   Zawscli.customizations.utilsr   r   r   r   r
   r   r	   r   r   r   r   r   <module>   s   