%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�(�fT
���ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZmZGd�d	e
e�Zd
efd�Zde	d
efd
�Zedded��Zdddeej*dfej,dfej.dfgddd�Zy)�)�secret_manager)�
exceptions)�APIEndpoint)�AdditionalInfo)�UAConfig)�UAContractClient)�
DataObject�Field�IntDataValue�StringDataValuec�x�eZdZeded��eded��eded��eded	��gZdedededefd
�Z	y)�MagicAttachInitiateResult�	user_codezACode the user will see in the UI when confirming the Magic Attach)�doc�tokenzgMagic Token that can be used in either `u.pro.attach.magic.revoke.v1`_ or `u.pro.attach.magic.wait.v1`_�expiresz0Timestamp of the Magic Attach process expiration�
expires_inz/Seconds before the Magic Attach process expiresc�<�||_||_||_||_y�N�rrrr)�selfrrrrs     �M/usr/lib/python3/dist-packages/uaclient/api/u/pro/attach/magic/initiate/v1.py�__init__z"MagicAttachInitiateResult.__init__.s ��#�����
����$���N)
�__name__�
__module__�__qualname__r
rr�fields�str�intr�rrrrs���
����		
�	���1�		
�	���B�	
�
	���A�	
�/�F�<
%��
%��
%��	
%�
�
%rr�returnc�(�tt��Sr)�	_initiaterr!rr�initiater%;s���X�Z� � r�cfgc	��t|�}|j�}tjj	|d�tjj	|d�t|d|d|dt
|d���S)z�
    This endpoint initiates the Magic Attach flow, retrieving the User Code to
    confirm the operation and the Token used to proceed.
    r�userCoder�	expiresInr)r�new_magic_attach_tokenr�secrets�
add_secretrr )r&�contract�
initiate_resps   rr$r$?s���
 ��$�H��3�3�5�M����%�%�m�G�&<�=����%�%�m�J�&?�@�$��
�+��G�$��i�(��}�[�1�2�	�r�v1�MagicAttachInitiateN)�version�name�fn�options_clsz27.11TzW
from uaclient.api.u.pro.attach.magic.initiate.v1 import initiate

result = initiate()
zARaised if it is not possible to connect to the contracts service.zLRaised if there is an unexpected error in the contracts service interaction.zHRaised if the Magic Attach service is busy or unavailable at the moment.z&pro api u.pro.attach.magic.initiate.v1z�
{
    "user_code":"<UI_code>",
    "token":"<magic_token>",
    "expires": "<yyyy-MM-dd>T<HH:mm:ss>.<TZ>",
    "expires_in": 600
}
)�
introduced_in�requires_network�example_python�result_classr�example_cli�example_json)�uaclientr�uaclient.apir�uaclient.api.apir�uaclient.api.data_typesr�uaclient.configr�uaclient.contractr�uaclient.data_typesr	r
rrrr%r$�endpoint�ConnectivityError�ContractAPIError�MagicAttachUnavailable�_docr!rr�<module>rGs���#�#�(�2�$�.���)%�
�N�)%�X!�+�!��8�� 9��"��	���	�����
.�
�(�(��	
�
�'�'�(�	
�
�-�-��	
��.<��C)�r

Zerion Mini Shell 1.0