HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/uaclient/api/u/pro/packages/updates/__pycache__/v1.cpython-310.pyc
o

��Jh��@s�ddlmZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
ddlmZmZmZmZGdd�de	�ZGd	d
�d
e	�ZGdd�de	e�Zd
efdd�Zded
efdd�Zeddedd�Zdddegddd�ZdS)�)�List)�APIEndpoint)�AdditionalInfo)�UAConfig)�
DataObject�Field�IntDataValue�StringDataValue�	data_list)�create_updates_list�filter_updates� get_installed_packages_by_origin�get_ua_infoc
@sjeZdZededd�ededd�ededd�eded	d�ed
edd�gZdedededed
ef
dd
�ZdS)�
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`` pocketcCs"||_||_||_||_||_dS�N�rrrrr)�selfrrrrr�r�H/usr/lib/python3/dist-packages/uaclient/api/u/pro/packages/updates/v1.py�__init__0s

zUpdateSummary.__init__N)�__name__�
__module__�__qualname__rr�fields�intrrrrrrsH�����������rc@szeZdZededd�ededd�ededd�eded	d�ed
edd�eded
d�gZdedededed
edefdd�Z	dS)�
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 updatecCs(||_||_||_||_||_||_dSr�r#r$r%r&r'r()rr#r$r%r&r'r(rrrr[s	
zUpdateInfo.__init__N)
rrrrrr	r r!�strrrrrrr"?sN������������r"c@sBeZdZededd�edee�dd�gZdedeefdd�Z	dS)	�PackageUpdatesResult�summaryz Summary of all available updatesr�updatesz&Detailed list of all available updatescCs||_||_dSr�r,r-)rr,r-rrrrxs
zPackageUpdatesResult.__init__N)
rrrrrr
r"r rrrrrrr+ls���r+�returncCs
tt��Sr)�_updatesrrrrrr-}s
r-�cfgcCs�t|�}t�}t|d�}t||�}t|d�}t|d�}t|d�}t|d�}t||||||||d�}	dd�|D�}
t|	|
d	�S)
zx
    This endpoint shows available updates for packages in a system, categorised
    by where they can be obtained.
    �allzesm-appsz	esm-infrazstandard-securityzstandard-updatesrc
Ss8g|]}t|d|d|d|d|d|dd��qS)r#r$r%�service_namer'r(r))r")�.0�updaterrr�
<listcomp>�s	���z_updates.<locals>.<listcomp>r.)rr
rr�lenrr+)r1�ua_info�packages�upgradable_versions�update_listrrrrr,r-rrrr0�s6
�����
	�r0�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_typesrrrr	r
�uaclient.security_statusrrr
rrr"r+r-r0�endpoint�_docrrrr�<module>s2*-*�
�