
    Uٵg7                         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l
mZmZmZ d dlmZ  G d d	e      Z G d
 dee      ZdefdZde	defdZ edded      ZdddeedfgdddZy)    )messages)APIEndpoint)AdditionalInfo)APIError)UAConfig)
DataObjectFieldStringDataValue)get_versionc                   $    e Zd Zej                  Zy)VersionErrorN)__name__
__module____qualname__r   E_API_VERSION_ERROR_formatted_msg     ?/usr/lib/python3/dist-packages/uaclient/api/u/pro/version/v1.pyr   r   
   s    11Nr   r   c                   0    e Zd Z eded      gZdefdZy)VersionResultinstalled_versionzThe current installed version)docc                    || _         y Nr   )selfr   s     r   __init__zVersionResult.__init__   s
    !2r   N)r   r   r   r	   r
   fieldsstrr   r   r   r   r   r      s&    /	
F3S 3r   r   returnc                  (    t        t                     S r   )_versionr   r   r   r   versionr$      s    HJr   cfgc                 |    	 t               }t	        |      S # t        $ r}t        t        |            d}~ww xY w)z?
    This endpoint shows the installed Pro Client version.
    )	error_msgNr   )r   	Exceptionr   r    r   )r%   r$   es      r   r#   r#      s<    -- 733  -SV,,-s   
 	;6;v1VersionN)r$   namefnoptions_clsz27.11FzG
from uaclient.api.u.pro.version.v1 import version

result = version()
z2Raised if the Client cannot determine the version.zpro api u.pro.version.v1z+
{
    "installed_version": "32.3~24.04"
}
)introduced_inrequires_networkexample_pythonresult_class
exceptionsexample_cliexample_json)uaclientr   uaclient.api.apir   uaclient.api.data_typesr   uaclient.api.errorsr   uaclient.configr   uaclient.data_typesr   r	   r
   uaclient.versionr   r   r   r$   r#   endpoint_docr   r   r   <module>r?      s     ( 2 ( $ B B (28 2
3J 
3   4( 4} 4 		 
 "	KL .r   