o
    !d                     @   sd   d dl Z d dlmZ dZdZddddZd	d
 ZG dd deZG dd deZ	dd Z
dd ZdS )    N)CustomArgumentz<p>The content of the image to be uploaded. To specify the content of a local file use the fileb:// prefix. Example: fileb://image.png</p>z=<p>To specify a local file use <code>--%s</code> instead.</p>zsource-image-bytesztarget-image-byteszimage-bytes)zcompare-faces.source-imagezcompare-faces.target-imagez*.imagec                 C   s<   t  D ]\}}|dd\}}| d| t|| qd S )N.   z&building-argument-table.rekognition.%s)FILE_PARAMETER_UPDATESitemsrsplitregisterImageArgUpdater)clitarget	new_paramZ	operation	old_param r   Eusr/lib/python3.10/site-packages/awscli/customizations/rekognition.py"register_rekognition_detect_labels!   s   
r   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
r	   c                 C   s   || _ || _d S N)_source_param
_new_param)selfsource_paramr   r   r   r   __init__)   s   
zImageArgUpdater.__init__c                 K   s$   |  |sd S | || j| j d S r   )_valid_target_update_paramr   r   )r   Zsessionargument_tablekwargsr   r   r   __call__-   s
   

zImageArgUpdater.__call__c                 C   s@   | j |v r|| j  }|j}|jd}|d ur|jdkrdS dS )NBytesblobTF)r   Zargument_modelmembersget	type_name)r   r   paramZinput_modelZbytes_memberr   r   r   r   3   s   

zImageArgUpdater._valid_targetc                 C   s<   t ||tdd||< d|| _t| }||  j|7  _d S )Nr   )Z	help_textZcli_type_nameF)ImageArgumentIMAGE_FILE_DOCSTRINGrequiredIMAGE_DOCSTRING_ADDENDUMdocumentation)r   r   r   r   Zdoc_addendumr   r   r   r   ?   s   

zImageArgUpdater._update_paramN)__name__
__module____qualname__r   r   r   r   r   r   r   r   r	   (   s
    r	   c                       s$   e Zd Z fddZdd Z  ZS )r"   c                    s&   t t| j|fi | t|| _d S r   )superr"   r   reverse_xform_name_parameter_to_overwrite)r   namer   r   	__class__r   r   r   I   s   zImageArgument.__init__c                 C   sB   |d u rd S d|i}| | jr|| j | d S ||| j< d S )Nr   )r   r,   update)r   
parametersvalueZimage_file_paramr   r   r   add_to_paramsM   s   zImageArgument.add_to_params)r'   r(   r)   r   r3   __classcell__r   r   r.   r   r"   H   s    r"   c                 C   s   |  dd S )Nr   -)grouplstripupper)matchr   r   r   _upperW   s   r:   c                 C   s   t dt| S )Nz(^.|-.))resubr:   )r-   r   r   r   r+   [   s   r+   )r;   Zawscli.argumentsr   r#   r%   r   r   objectr	   r"   r:   r+   r   r   r   r   <module>   s    