o
    Ki	                     @   sV   d dl Z d dlmZmZ d dlmZmZ G dd de jdZG dd dee jdZ	dS )	    N)AnyDict)configcontractc                   @   sj   e Zd ZeejdefddZejdej	de
fddZejdefddZejd	edefd
dZdS )AutoAttachInstancereturnc                 C      dS )z?Return True if the machine is a viable AutoAttachCloudInstance.N selfr	   r	   :/usr/lib/python3/dist-packages/uaclient/clouds/__init__.py	is_viable      zAutoAttachInstance.is_viablecfgc                 C   r   ){
        Cloud-specific implementation of acquiring the pro token using whatever
        method suits the platform
        Nr	   )r   r   r	   r	   r   acquire_pro_token      z$AutoAttachInstance.acquire_pro_tokenc                 C   r   )zw
        Cloud-specific checks for whether the daemon should continously poll
        for Ubuntu Pro licenses.
        Nr	   r
   r	   r	   r   should_poll_for_pro_license   r   z.AutoAttachInstance.should_poll_for_pro_licensewait_for_changec                C   r   )z1
        Check for an Ubuntu Pro license
        Nr	   )r   r   r	   r	   r   is_pro_license_present   s   z)AutoAttachInstance.is_pro_license_presentN)__name__
__module____qualname__propertyabcabstractmethodboolr   r   UAConfigstrr   r   r   r	   r	   r	   r   r      s    r   )	metaclassc                   @   sX   e Zd Zeejdeeef fddZ	eejdefddZ
dejdefddZd	S )
PublicCloudAutoAttachInstancer   c                 C   r   )z=Return the identity document representing this cloud instanceNr	   r
   r	   r	   r   identity_doc'   r   z*PublicCloudAutoAttachInstance.identity_docc                 C   r   )z=Return a string of the cloud type on which this instance runsNr	   r
   r	   r	   r   
cloud_type-   r   z(PublicCloudAutoAttachInstance.cloud_typer   c                 C   s$   t |}|j| j| jd}|d S )r   )r"   datacontractToken)r   UAContractClient%get_contract_token_for_cloud_instancer"   r!   )r   r   contract_clienttoken_responser	   r	   r   r   3   s
   
z/PublicCloudAutoAttachInstance.acquire_pro_tokenN)r   r   r   r   r   r   r   r   r   r!   r"   r   r   r   r	   r	   r	   r   r    &   s    r    )
r   typingr   r   uaclientr   r   ABCMetar   r    r	   r	   r	   r   <module>   s
    