o
    (f}	                     @   s   d dl Z d dlZd dlmZ d dlmZmZ d dlmZm	Z	 d dl
mZ d dlmZ d dlmZmZmZ d dlmZ G d	d
 d
eZdd Zede	je	jeejeede	jddede	jddede	jdg ddede	jdddgdgdZdS )    N)OrderedDict)AnyOptional)
exceptionsmessages)AbstractProgress)call_api)ProArgumentProArgumentGroup
ProCommand)HelpCategoryc                	   @   s.   e Zd Zdededee dee fddZdS )CLIAPIProgresstotal_steps
done_stepsprevious_step_messagecurrent_step_messagec                C   s8   t  }||d< ||d< ||d< ||d< tt| d S )Nr   r   r   r   )r   printjsondumps)selfr   r   r   r   d r   2/usr/lib/python3/dist-packages/uaclient/cli/api.pyprogress   s   zCLIAPIProgress.progressN)__name__
__module____qualname__intr   strr   r   r   r   r   r      s    r   c                K   s   | j r
| jr
t | jr| jdkrtj stj | _| jr$t	 }nd }t
| j| j | j||}t|  |jdkr>dS dS )N-successr      )optionsdatar   CLIAPIOptionsXORDatasysstdinisattyreadshow_progressr   r   endpoint_pathr   to_jsonresult)argscfgkwargsr   r,   r   r   r   
action_api   s   
r0   apir*   endpoint)helpmetavarz--show-progress
store_true)r3   actionz--argsr"   *)r3   destdefaultnargsz--datar#    )r3   r8   r9   )	arguments)r3   descriptionr6   help_categoryargument_groups)r   r%   collectionsr   typingr   r   uaclientr   r   uaclient.apir   uaclient.api.apir   uaclient.cli.commandsr	   r
   r   uaclient.cli.parserr   r   r0   CLI_ROOT_APICLI_API_DESCOTHERCLI_API_ENDPOINTCLI_API_SHOW_PROGRESSCLI_API_ARGSCLI_API_DATAapi_commandr   r   r   r   <module>   sZ    
