%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�(�f��
�J�ddlZddlmZddlmZmZmZmZmZm	Z	ddl
mZmZddl
mZmZmZddlmZddlmZddlmZmZdd	lmZgd
�Zdeedeed
e	eeefeeffd�Zdedeed
e	eeefeeffd�Z	ddedeedededeed
efd�ZGd�d�Zy)�N)�
import_module)�Any�Callable�Dict�List�Optional�Tuple)�AbstractProgress�errors)�APIData�APIResponse�ErrorWarningObject)�UAConfig)�IncorrectFieldTypeError)�API_UNKNOWN_ARG�WARN_NEW_VERSION_AVAILABLE)�check_for_new_version)zu.pro.version.v1z,u.pro.attach.auto.configure_retry_service.v1z%u.pro.attach.auto.full_auto_attach.v1z'u.pro.attach.auto.should_auto_attach.v1zu.pro.attach.magic.initiate.v1zu.pro.attach.magic.revoke.v1zu.pro.attach.magic.wait.v1z'u.pro.attach.token.full_token_attach.v1zu.pro.detach.v1zu.pro.packages.summary.v1zu.pro.packages.updates.v1z!u.pro.security.fix.cve.execute.v1zu.pro.security.fix.cve.plan.v1z!u.pro.security.fix.usn.execute.v1zu.pro.security.fix.usn.plan.v1z'u.pro.security.status.livepatch_cves.v1z(u.pro.security.status.reboot_required.v1zu.pro.services.dependencies.v1zu.pro.services.disable.v1zu.pro.services.enable.v1z u.pro.status.enabled_services.v1zu.pro.status.is_attached.v1zu.apt_news.current_news.v1zu.security.package_manifest.v1zu.unattended_upgrades.status.v1�options�fields�returnc�h�i}g}|D]�}	|jd�\}}|r|stj|���||vrI|j	tt
j|��jtji���|||<��||fS#t$rtj|���wxYw)N�=��arg��title�code�meta)
�split�
ValueErrorr�APIBadArgsFormat�appendrr�format�msg�name)rr�kwargs�warnings�option�k�vs       �2/usr/lib/python3/dist-packages/uaclient/api/api.py�_process_optionsr,)s����F��H����	6��<�<��$�D�A�q����)�)�f�5�5��F�?��O�O�"�)�0�0�Q�7�;�;�(�-�-���
���q�	�%�(�8����#�	6��)�)�f�5�5�	6�s�B� B1�datac��i}g}	tj|�}|j
�D]W\}}||vrI|jttj|��jtji���|||<�Y||fS#tjj$rt	j
|���wxYw)N)r-rr)
�json�loads�decoder�JSONDecodeErrorr�APIJSONDataFormatError�itemsr"rrr#r$r%)r-rr&r'�	json_datar)r*s       r+�
_process_datar6Fs����F��H�7��J�J�t�$�	����!�
���1��F�?��O�O�"�)�0�0�Q�7�;�;�(�-�-���
���q�	�
��8�����<�<�'�'�7��+�+��6�6�7�s�B	�	4B=�
endpoint_path�cfg�progress_objectc	���|tvr)tjtj|���St	d|z�}|j
}g}|jr�|jjD�cgc]}|j��}	}	|rt||	�\}
}n|rt||	�\}
}nig}}
|j|�	|jj|
�}	|j r|j#|||��}
n|j#||�}
n_|s|r)tjtj&|���S	|j r|j#||��}
n|j#|�}
t)�}|rI|j+t-t/j0|��j2t.j4i���t7|j8|
j:|zt=|j4|
|
j>����Scc}w#tj$r}tj|�cYd}~Sd}~wwxYw#t$r>}tjtj|j|���cYd}~Sd}~wwxYw#t$$r}tj|�cYd}~Sd}~wwxYw#t$$r}tj|�cYd}~Sd}~wwxYw)	N)�endpointz
uaclient.api.)rr;)r9)�versionr)�type�
attributesr)�_schema_versionr'r-) �VALID_ENDPOINTSr�	error_out�APIInvalidEndpointrr;�options_clsr�keyr,r6�extend�APIError�	from_dictr�
APIMissingArg�supports_progress�fn�	Exception�APINoArgsForEndpointrr"rrr#r$r%r
r<r'rr)r7rr-r8r9�moduler;�option_warnings�frr&r'�e�result�new_versions               r+�call_apirS`s����O�+�����%�%�}�=�
�	
��?�]�:�
;�F����H��O����!)�!5�!5�!<�!<�=�A�!�%�%�=��=�		'��#3�G�V�#D� ����#0��v�#>� ���#%�r����"�"�8�,�	��*�*�4�4�V�<�G�	'��)�)�!����S�/�%���"���W�c�2���
�d��#�#��+�+�]�C��
�	'��)�)�!���S�/��J��!���S�)��(�)�K������0�7�7�'���#�/�4�4��
�	
�� �(�(����?�2�
��������
����m>�����	'��#�#�A�&�&��	'��
'�	��#�#��$�$�����G��
��	���	'��#�#�A�&�&��	'���	'��#�#�A�&�&��	'�s~�2H�9H�I�3J�1J:�I�#H=�7I�=I�	J�3J�J�J�	J7�J2�,J7�2J7�:	K"�K�K"�K"c	�(�eZdZ	ddedededefd�Zy)�APIEndpointr<r%rJrIc�J�||_||_||_||_||_y�N)r<r%rJrCrI)�selfr<r%rJrCrIs      r+�__init__zAPIEndpoint.__init__�s)�������	����&���!2���N)F)�__name__�
__module__�__qualname__�strr�boolrY�rZr+rUrU�s2��#(�
3��3��3�
�	3� �
3rZrUrW) r/�	importlibr�typingrrrrrr	�uaclient.apir
r�uaclient.api.data_typesrr
r�uaclient.configr�uaclient.data_typesr�uaclient.messagesrr�uaclient.versionrr@r^r,r6rSrUr`rZr+�<module>ris���#�=�=�1�L�L�$�7�I�2���:�
�#�Y�� $�S�	��
�4��S��>�4� 2�3�3�4��:�

���C�y��
�4��S��>�4� 2�3�3�4��>37�Q��Q�
�#�Y�Q��Q�
�	Q�
�.�/�Q��
Q�h
3�
3rZ

Zerion Mini Shell 1.0