
    Jh                         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	e      Zd	efd
Zded	efdZ edded      Zdddeg dddZy)    )Optional)APIEndpoint)AdditionalInfo)UAConfig)
DataObjectFieldStringDataValue)apt_news_raw_filec                   8    e Zd Z ededd      gZdee   fdZy)CurrentNewsResultcurrent_newsFzThe current APT News to be displayed for the system. This could be a str with up to three lines (i.e. up to two ``\n`` characters). If there is no APT News to be displayed, this will be ``None``.)requireddocc                    || _         y Nr   )selfr   s     I/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/v1.py__init__zCurrentNewsResult.__init__   s
    (    N)	__name__
__module____qualname__r   r	   fieldsr   strr    r   r   r   r   
   s/    5
	
F) )r   r   returnc                  (    t        t                     S r   )_current_newsr   r   r   r   r   r      s    $$r   cfgc                 >    t        t        j                               S )z^
    This endpoint returns the current APT News that gets displayed in
    `apt upgrade`.
    r   )r   r
   read)r    s    r   r   r   !   s    
 *;*@*@*BCCr   v1CurrentNewsN)versionnamefnoptions_cls29Fzh
from uaclient.api.u.apt_news.current_news.v1 import current_news

result = current_news().current_news
z"pro api u.apt_news.current_news.v1zx
{
    "current_news":"This is a news message.\nThis is the second line of the message.\nAnd this is the third line."
}
)introduced_inrequires_networkexample_pythonresult_class
exceptionsexample_cliexample_json)typingr   uaclient.api.apir   uaclient.api.data_typesr   uaclient.configr   uaclient.data_typesr   r   r	   uaclient.files.state_filesr
   r   r   r   endpoint_docr   r   r   <module>r9      s     ( 2 $ B B 8)
N )&%' %Dx D$5 D 		 
 &7r   