%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�(�f%��H�ddlZddlmZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZmZej"ej$e��ZGd�d	e
�ZGd
�de
�ZGd�d
e
�ZGd�de
e	�Zdefd�Zdedefd�Zedded��Zdddeddd�Zy)�N)�List)�entitlements�util)�APIEndpoint)�AdditionalInfo)�UAConfig)�
DataObject�Field�StringDataValue�	data_listc�H�eZdZeded��eded��gZdedefd�Zy)�Reason�codez'Short string that represents the reason��doc�titlez9Longer string describing the reason - possibly translatedc� �||_||_y�N�rr)�selfrrs   �M/usr/lib/python3/dist-packages/uaclient/api/u/pro/services/dependencies/v1.py�__init__zReason.__init__s����	���
�N)�__name__�
__module__�__qualname__r
r�fields�strr�rrrr
s@��
���9�	
�
	���K�	
�
�F����C�rrc�H�eZdZeded��eded��gZdedefd�Zy)�ServiceWithReason�name�0Name of the Pro service this item corresponds tor�reasonz0Reason that this service is in the list it is inc� �||_||_yr�r"r$)rr"r$s   rrzServiceWithReason.__init__.s����	���rN)	rrrr
rrrrrrrrr!r! s@��
���B�	
�
	���B�	
�
�F����V�rr!c��eZdZeded��edee�d��edee�d��gZdede	ede	efd�Z
y	)
�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.c�.�||_||_||_yr�r"r)r*)rr"r)r*s    rrz ServiceWithDependencies.__init__Ls����	�!2���$��rN)rrrr
rrr!rrrrrrrr(r(3s���
���B�	
�
	���'�(�B�		
�	���'�(�P�		
��F�0	%��	%� � 1�2�		%�
�*�+�	%rr(c�B�eZdZedee�d��gZdeefd�Zy)�DependenciesResult�servicesz*Each Pro service gets an item in this listrc��||_yr�r/)rr/s  rrzDependenciesResult.__init__as	�� ��
rN)	rrrr
rr(rrrrrrr.r.Xs2��
���-�.�<�	
��F�!�D�)@�$A�!rr.�returnc�(�tt��Sr)�
_dependenciesrrrr�dependenciesr5es�����$�$r�cfgc��g}tjD�]}||�}g}g}|jD]e}|jt	|j
jt|jj|jj������g|jD]e}|jt	|j
jt|jj|jj������g|jt|j||�����!t|��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,r1)
r�ENTITLEMENT_CLASSES�incompatible_services�appendr!�entitlementr"r�	named_msg�msg�required_servicesr(r.)r6r/�ent_cls�entr)r*�ent_with_reasons       rr4r4is$���H��3�3�
���c�l�����
�"�8�8�		�O��$�$�!�(�4�4�9�9�!�,�6�6�;�;�-�7�7�;�;���
�		� #�4�4�		�O����!�(�4�4�9�9�!�,�6�6�;�;�-�7�7�;�;���
�		�	���#��\�\�"3�%�
�	
�1
�>�x�0�0r�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_typesr	r
rr�	getLogger�replace_top_level_logger_namer�LOGrr!r(r.r5r4�endpoint�_docrrr�<module>rZs�����'�(�2�$�M�M��g���:��:�:�8�D�E���Z��&�
��&"%�j�"%�J
!��^�
!�%�(�%�'1�x�'1�$6�'1�T��	���	�����'�;��'�r

Zerion Mini Shell 1.0