+
     g[                     P   ^ RI t ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHt ^Ft ! R R	]4      t ! R
 R]]4      tR R ltR R lt]! RR]]R7      tRRRRRRR]R]P.                  R3]P0                  R3]P2                  R3]P4                  R3.RR R!R"/tR# )#    N)
exceptionssecret_manager)APIEndpoint)AdditionalInfo)UAConfig)UAContractClient)
DataObjectFieldIntDataValueStringDataValuec                   J   a  ] tR t^t o ]! R]RR7      .tV 3R lR ltRtV t	R# )MagicAttachWaitOptionsmagic_tokenz,The Token provided by the initiate endpoint.docc                    < V ^8  d   QhRS[ /# )   r   )str)format__classdict__s   "I/usr/lib/python3/dist-packages/uaclient/api/u/pro/attach/magic/wait/v1.py__annotate__#MagicAttachWaitOptions.__annotate__   s     ' 'C '    c                    Wn         R # Nr   )selfr   s   &&r   __init__MagicAttachWaitOptions.__init__   s    &r   r   N)
__name__
__module____qualname____firstlineno__r
   r   fieldsr   __static_attributes____classdictcell__r   s   @r   r   r      s'     >	
F' 'r   r   c                      a  ] tR t^t o ]! R]RR7      ]! R]RR7      ]! R]RR7      ]! R]R	R7      ]! R
]RR7      ]! R]RR7      .tV 3R lR ltRt	V t
R# )MagicAttachWaitResult	user_codezACode the user will see in the UI when confirming the Magic Attachr   tokenz1The same Magic Token that was sent as an argumentexpiresz0Timestamp of the Magic Attach process expiration
expires_inz/Seconds before the Magic Attach process expirescontract_idz2ID of the contract the machine will be attached tocontract_tokenz(The contract Token to attach the machinec                >   < V ^8  d   QhRS[ RS[ RS[ RS[RS[ RS[ /# )r   r+   r,   r-   r.   r/   r0   )r   int)r   r   s   "r   r   "MagicAttachWaitResult.__annotate__D   sG     - -- - 	-
 - - -r   c                N    Wn         W n        W0n        W@n        WPn        W`n        R # r   r+   r,   r-   r.   r/   r0   )r   r+   r,   r-   r.   r/   r0   s   &&&&&&&r   r   MagicAttachWaitResult.__init__D   s$     #
$&,r   )r/   r0   r-   r.   r,   r+   N)r!   r"   r#   r$   r
   r   r   r%   r   r&   r'   r(   s   @r   r*   r*      s     		
 	C	

 	B	

 	A	

 	D	

 	:	
;"FH- -r   r*   c                0    V ^8  d   QhR\         R\        /# )r   optionsreturn)r   r*   )r   s   "r   r   r   U   s     & &#&&r   c                 *    \        V \        4       4      # r   )_waitr   )r8   s   &r   waitr<   U   s     (*%%r   c                <    V ^8  d   QhR\         R\        R\        /# )r   r8   cfgr9   )r   r   r*   )r   s   "r   r   r   [   s$     7- 7-#7-*27-7-r   c           	        \        V4      p^ p^ p^
p\        P                  P                  V P                  4       V\
        8  d   Rp VP                  V P                  R7      p^ pT'       dX   TP                  R4      eE   \        TR,          TR,          TR,          \        TR,          4      TR,          TR,          R	7      # T'       d   ^
p\        P                  ! T4       T^,          pK  \        P                  ! 4       h  \        P                   d     K-  \        P                   d    ^p L\        P                   d   pT^8  d   T^,          p Rp?LThRp?ii ; i)
z]
This endpoint polls the contracts service waiting for the user to confirm
the Magic Attach.
Nr   contractTokenuserCoder,   r-   	expiresIn
contractIDr5   )r   r   secrets
add_secretr   MAXIMUM_ATTEMPTSget_magic_attach_token_infor   MagicAttachTokenErrorMagicAttachUnavailableConnectivityErrorgetr*   r2   timesleep)r8   r>   contractnum_attemptsnum_connection_errors	wait_time	wait_respes   &&      r   r;   r;   [   sN     $HLI%%g&9&9:
)
)		 <<#// = I %&!& 7C(#J/(!),y56%l3(9  I

9

*
*
,,C // 	 00 	I ++ 	$q(%*%		s6   	D E&E&1E&6E&	E&
E!E!!E&v1MagicAttachWait)versionnamefnoptions_clsintroduced_inz27.11requires_networkTexample_pythonz
from uaclient.api.u.pro.attach.magic.wait.v1 import MagicAttachWaitOptions, wait

options = MagicAttachWaitOptions(magic_token="<magic_token>")
result = wait(options)
result_classr   zARaised if it is not possible to connect to the contracts service.zLRaised if there is an unexpected error in the contracts service interaction.z-Raised when an invalid/expired Token is sent.zHRaised if the Magic Attach service is busy or unavailable at the moment.example_clizCpro api u.pro.attach.magic.wait.v1 --args magic_token=<magic_token>example_jsonz
{
    "user_code":"<UI_code>",
    "token":"<magic_token>",
    "expires": "<yyyy-MM-dd>T<HH:mm:ss>.<TZ>",
    "expires_in": 500,
    "contract_id": "<Contract-ID>",
    "contract_token": "<attach_token>",
}
)rL   uaclientr   r   uaclient.api.apir   uaclient.api.data_typesr   uaclient.configr   uaclient.contractr   uaclient.data_typesr	   r
   r   r   rF   r   r*   r<   r;   endpointrJ   ContractAPIErrorrH   rI   _doc r   r   <module>rj      s     / ( 2 $ .   
'Z 
'3-J 3-l&7-t 	&	 W  )((	
 ''(	
 ,,;	

 --	
'6 X 	M0r   