o
    ÙKÕiö  ã                   @   sª   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„ de	eƒZd	efd
d„Zded	efdd„Zeddedd�Zdddeg dddœZdS )é    )ÚOptional)ÚAPIEndpoint)ÚAdditionalInfo)ÚUAConfig)Ú
DataObjectÚFieldÚStringDataValue)Úapt_news_raw_filec                   @   s0   e Zd Zededdd�gZdee fdd„ZdS )ÚCurrentNewsResultÚcurrent_newsFzÃThe 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                C   s
   || _ d S ©N©r   )Úselfr   © r   úI/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/v1.pyÚ__init__   ó   
zCurrentNewsResult.__init__N)	Ú__name__Ú
__module__Ú__qualname__r   r   Úfieldsr   Ústrr   r   r   r   r   r
   
   s    ûÿr
   Úreturnc                   C   s
   t tƒ ƒS r   )Ú_current_newsr   r   r   r   r   r      r   r   Úcfgc                 C   s   t t ¡ d�S )z^
    This endpoint returns the current APT News that gets displayed in
    `apt upgrade`.
    r   )r
   r	   Úread)r   r   r   r   r   !   s   r   Ú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   r   Ú<module>   s.    ü
õ