
    UٵgR
              
       T   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZmZmZ  G d de      Z G d	 d
ee      ZdedefdZdededefdZ eddee      Zdddeej&                  dfej(                  dfej*                  dfej,                  dfej.                  dfgdddZy)    )
exceptions)APIEndpoint)AdditionalInfo)UAConfig)UAContractClient)
DataObjectFieldStringDataValuec                   *    e Zd Z eded      gZd Zy)MagicAttachRevokeOptionsmagic_tokenz,The Token provided by the initiate endpoint.)docc                     || _         y N)r   )selfr   s     K/usr/lib/python3/dist-packages/uaclient/api/u/pro/attach/magic/revoke/v1.py__init__z!MagicAttachRevokeOptions.__init__   s
    &    N)__name__
__module____qualname__r	   r
   fieldsr    r   r   r   r   	   s    >	
F'r   r   c                       e Zd Zy)MagicAttachRevokeResultN)r   r   r   r   r   r   r   r      s    r   r   optionsreturnc                 *    t        | t                     S r   )_revoker   )r   s    r   revoker       s    7HJ''r   cfgc                 b    t        |      }|j                  | j                         t               S )z5
    This endpoint revokes a Magic Attach Token.
    )r   revoke_magic_attach_tokenr   r   )r   r!   contracts      r   r   r      s+      $H&&w':':;"$$r   v1MagicAttachRevoke)versionnamefnoptions_clsz27.11Tz
from uaclient.api.u.pro.attach.magic.revoke.v1 import MagicAttachRevokeOptions, revoke

options = MagicAttachWaitOptions(magic_token="<magic_token>")
result = revoke(options)
zARaised if it is not possible to connect to the contracts service.zLRaised if there is an unexpected error in the contracts service interaction.zPRaised when trying to revoke a Token which was already activated through the UI.z-Raised when an invalid/expired Token is sent.zHRaised if the Magic Attach service is busy or unavailable at the moment.z?pro api u.pro.attach.magic.revoke.v1 --args magic_token=<token>z
{}
)introduced_inrequires_networkexample_pythonresult_classr   example_cliexample_jsonN)uaclient.apir   uaclient.api.apir   uaclient.api.data_typesr   uaclient.configr   uaclient.contractr   uaclient.data_typesr   r	   r
   r   r   r    r   endpointConnectivityErrorContractAPIError MagicAttachTokenAlreadyActivatedMagicAttachTokenErrorMagicAttachUnavailable_docr   r   r   <module>r>      s   # ( 2 $ . B B
'z 
'	j. 	(, (1H (	%%	%,4	%	% 	(	  , ((	
 ''(	
 77-	
 ,,;	

 --	
5!D U[0r   