o
    ÙKÕiR
  ã                
   @   sê   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„ deƒZG d	d
„ d
eeƒZdedefdd„Zdededefdd„Zeddeed�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d S )!é    )Ú
exceptions)ÚAPIEndpoint)ÚAdditionalInfo)ÚUAConfig)ÚUAContractClient)Ú
DataObjectÚFieldÚStringDataValuec                   @   s$   e Zd Zededd�gZdd„ ZdS )ÚMagicAttachRevokeOptionsÚmagic_tokenz,The Token provided by the initiate endpoint.)Údocc                 C   s
   || _ d S ©N)r   )Úselfr   © r   úK/usr/lib/python3/dist-packages/uaclient/api/u/pro/attach/magic/revoke/v1.pyÚ__init__   s   
z!MagicAttachRevokeOptions.__init__N)Ú__name__Ú
__module__Ú__qualname__r   r	   Úfieldsr   r   r   r   r   r
   	   s    ýÿr
   c                   @   s   e Zd ZdS )ÚMagicAttachRevokeResultN)r   r   r   r   r   r   r   r      s    r   ÚoptionsÚreturnc                 C   s   t | tƒ ƒS r   )Ú_revoker   )r   r   r   r   Úrevoke   s   r   Úcfgc                 C   s   t |ƒ}| | j¡ tƒ S )z5
    This endpoint revokes a Magic Attach Token.
    )r   Úrevoke_magic_attach_tokenr   r   )r   r   Úcontractr   r   r   r      s   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   r   Ú<module>   sZ    ÿÿ
þüýýýþýæ"
Ó