%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/uaclient/api/u/pro/packages/updates/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/uaclient/api/u/pro/packages/updates/__pycache__/v1.cpython-312.pyc

�

�(�f�����ddlmZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
ddlmZmZmZmZGd�de	�ZGd	�d
e	�ZGd�de	e�Zd
efd�Zded
efd�Zedded��Zdddegddd�Zy)�)�List)�APIEndpoint)�AdditionalInfo)�UAConfig)�
DataObject�Field�IntDataValue�StringDataValue�	data_list)�create_updates_list�filter_updates� get_installed_packages_by_origin�get_ua_infoc
��eZdZeded��eded��eded��eded	��ed
ed��gZdedededed
ef
d�Zy
)�
UpdateSummary�num_updatesz Total count of available updates��doc�num_esm_apps_updatesz,Count of available updates from ``esm-apps``�num_esm_infra_updatesz-Count of available updates from ``esm-infra``�num_standard_security_updatesz8Count of available updates from the ``-security`` pocket�num_standard_updatesz7Count of available updates from the ``-updates`` pocketc�J�||_||_||_||_||_y�N�rrrrr)�selfrrrrrs      �H/usr/lib/python3/dist-packages/uaclient/api/u/pro/packages/updates/v1.py�__init__zUpdateSummary.__init__0s,��'���$8��!�%:��"�-J��*�$8��!�N)�__name__�
__module__�__qualname__rr	�fields�intr�rrrrs���
��<�-O�	
�	�"��>�	
�
	�#��?�	
�
	�+��J�	
�
	�"��I�	
�'�F�49��9�"�9� #�	9�
(+�9�"�
9rrc��eZdZeded��eded��eded��eded	��ed
ed��eded
��gZdedededed
edefd�Z	y)�
UpdateInfo�
download_sizez%Download size for the update in bytesr�originz#Where the update is downloaded from�packagez!Name of the package to be updated�provided_byz!Service which provides the update�statusz0Whether this update is ready for download or not�versionzVersion of the updatec�X�||_||_||_||_||_||_yr�r(r)r*r+r,r-)rr(r)r*r+r,r-s       rrzUpdateInfo.__init__[s0��+���������&��������rN)
r r!r"rr	r
r#r$�strrr%rrr'r'?s���
���7�	
�
	���5�	
�
	���,O�	
�	���3�	
�
	���B�	
�
	�i��.E�F�1�F�6������	�
���
��rr'c�Z�eZdZeded��edee�d��gZdedeefd�Z	y)�PackageUpdatesResult�summaryz Summary of all available updatesr�updatesz&Detailed list of all available updatesc� �||_||_yr�r3r4)rr3r4s   rrzPackageUpdatesResult.__init__xs�������rN)
r r!r"rrrr'r#rrr%rrr2r2lsI��
��}�*L�	
�	���j�!�8�	
�		�F��
���Z�8H�rr2�returnc�(�tt��Sr)�_updatesrr%rrr4r4}s���H�J��r�cfgc��t|�}t�}t|d�}t||�}t	|d�}t	|d�}t	|d�}t	|d�}t||z|z|z||||��}	|D�
cgc]%}
t
|
d|
d|
d	|
d
|
d|
d�
���'}}
t|	|��Scc}
w)zx
    This endpoint shows available updates for packages in a system, categorised
    by where they can be obtained.
    �allzesm-appsz	esm-infrazstandard-securityzstandard-updatesrr(r)r*�service_namer,r-r/r6)rrr
r�lenrr'r2)r:�ua_info�packages�upgradable_versions�update_listrrrrr3�updater4s            rr9r9�s��
�#��G�/�1�H�(��%��9��%�&9�7�C�K��2�:�>�?��� 3�K� @�A��$'��/�0�%�!��2�3E�F�G���(�
� �
'�(���2�3�&C�1�	�G�&"�
�
�	� ��1��(�#��9�%��~�.��(�#��9�%�
	
�
�G�
� ���A�A��
s�*B>�v1�PackageUpdatesN)r-�name�fn�options_clsz27.12FzP
from uaclient.api.u.pro.packages.updates.v1 import updates

result = updates()
z!pro api u.pro.packages.updates.v1a�
{
    "summary": {
        "num_updates": 1,
        "num_esm_apps_updates": 2,
        "num_esm_infra_updates": 3,
        "num_standard_security_updates": 4,
        "num_standard_updates": 5,
    },
    "updates": [
        {
            "download_size": 6,
            "origin": "<some site>",
            "package": "<package name>",
            "provided_by": "<service name>",
            "status": "<update status>",
            "version": "<updated version>",
        },
    ]
}
)�
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_typesrrr	r
r�uaclient.security_statusrr
rrrr'r2r4r9�endpoint�_docr%rr�<module>rXs����(�2�$�����'9�J�'9�T*��*�Z�:�~��" �%� �'B�(�'B�3�'B�T��	���	�����
)��6�� �r

Zerion Mini Shell 1.0