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/services/dependencies/__pycache__/v1.cpython-310.pyc
o

��Jh%�@s�ddlZddlmZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZmZe�e�e��ZGdd	�d	e
�ZGd
d�de
�ZGdd
�d
e
�ZGdd�de
e	�Zdefdd�Zdedefdd�Zeddedd�Zdddeddd�ZdS)�N)�List)�entitlements�util)�APIEndpoint)�AdditionalInfo)�UAConfig)�
DataObject�Field�StringDataValue�	data_listc@s:eZdZededd�ededd�gZdedefdd�ZdS)	�Reason�codez'Short string that represents the reason��doc�titlez9Longer string describing the reason - possibly translatedcC�||_||_dS�N�r
r)�selfr
r�r�M/usr/lib/python3/dist-packages/uaclient/api/u/pro/services/dependencies/v1.py�__init__�
zReason.__init__N)�__name__�
__module__�__qualname__r	r
�fields�strrrrrrr
����
rc@s:eZdZededd�ededd�gZdedefdd�ZdS)	�ServiceWithReason�name�0Name of the Pro service this item corresponds tor�reasonz0Reason that this service is in the list it is incCrr�r r")rr r"rrrr.rzServiceWithReason.__init__N)	rrrr	r
rrrrrrrrr rrc@sZeZdZededd�edee�dd�edee�dd�gZdede	ede	efdd	�Z
d
S)�ServiceWithDependenciesr r!r�incompatible_withzkList of Pro services this service is incompatible with. That means they cannot be enabled at the same time.�
depends_onzwList of Pro services this service depends on. The services in this list must be enabled for this service to be enabled.cCs||_||_||_dSr�r r%r&)rr r%r&rrrrLs
z ServiceWithDependencies.__init__N)rrrr	r
rrrrrrrrrrr$3s0�������r$c@s2eZdZedee�dd�gZdeefdd�ZdS)�DependenciesResult�servicesz*Each Pro service gets an item in this listrcCs
||_dSr�r))rr)rrrra�
zDependenciesResult.__init__N)	rrrr	rr$rrrrrrrr(Xs��r(�returncCs
tt��Sr)�
_dependenciesrrrrr�dependencieser+r.�cfgc
Cs�g}tjD]G}||�}g}g}|jD]}|�t|jjt|jj|jj	d�d��q|j
D]}|�t|jjt|jj|jj	d�d��q+|�t|j||d��qt|d�S)a
    This endpoint will return a full list of all service dependencies,
    regardless of the current system state. That means it will always return
    the same thing until new services are added, or until we add/remove
    dependencies between services.
    rr#r'r*)
r�ENTITLEMENT_CLASSES�incompatible_services�appendr�entitlementr r�	named_msg�msg�required_servicesr$r()r/r)�ent_cls�entr%r&�ent_with_reasonrrrr-isB

���
	���	��
r-�v1�ServiceDependencies)�versionr �fn�options_cls�32Fz^
from uaclient.api.u.pro.services.dependencies.v1 import dependencies
result = dependencies()
z&pro api u.pro.services.dependencies.v1a�
{
    "services": [
        {
            "name": "one",
            "depends_on": [
                {
                    "name": "zero",
                    "reason": {
                        "code": "one-and-zero",
                        "title": "Service One requires service Zero."
                    }
                },
                ...
            ],
            "incompatible_with": [
                {
                    "name": "two",
                    "reason": {
                        "code": "one-and-two",
                        "title": "Services One and Two are not compatible."
                    }
                },
                ...
            ]
        },
        ...
    ]
}
)�
introduced_in�requires_network�example_python�result_class�example_cli�example_json)�logging�typingr�uaclientrr�uaclient.api.apir�uaclient.api.data_typesr�uaclient.configr�uaclient.data_typesrr	r
r�	getLogger�replace_top_level_logger_namer�LOGrrr$r(r.r-�endpoint�_docrrrr�<module>s6%
*�
�