+
    =l j<  ã                   ó:  € ^ 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HtHtHtHt ^ RIHtHt ^ RIHt  ! R	 R
]]4      t] P,                   ! R R] P.                  4      4       tR R ltR R ltR R lt]! RR]RR7      tRRRRRRR]R. RRR R!R"R#/tR# )$é    N)ÚOptionalÚTuple)ÚAPIEndpoint)ÚAdditionalInfo)ÚUAConfig)ÚBoolDataValueÚ
DataObjectÚFieldÚIntDataValueÚStringDataValue)Ú!CONTRACT_EXPIRY_GRACE_PERIOD_DAYSÚCONTRACT_EXPIRY_PENDING_DAYS)Úmachine_tokenc            	       óˆ   a € ] tR t^t o ]! R]RR7      ]! R]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# )ÚIsAttachedResultÚis_attachedz=True if the machine is attached to an Ubuntu Pro subscription)ÚdocÚcontract_statusFz%Status of the Ubuntu Pro subscriptionÚcontract_remaining_daysz2Number of days left in the Ubuntu Pro subscriptionÚis_attached_and_contract_validzbTrue if the machine is attached to an Ubuntu Pro subscription and that subscription is not expiredc                óB   <€ V ^8„  d   QhRS[ RS[S[,          RS[RS[ /# )é   r   r   r   r   )Úboolr   ÚstrÚint)ÚformatÚ__classdict__s   "€ÚJ/usr/lib/python3/dist-packages/uaclient/api/u/pro/status/is_attached/v1.pyÚ__annotate__ÚIsAttachedResult.__annotate__3   s?   ø€ ÷ Mñ Mñ ðMñ "¡#�ð	Mñ
 "%ðMñ )-ñMó    c               ó6   € Wn         W n        W0n        W@n        R # ©N©r   r   r   r   )Úselfr   r   r   r   s   &$$$$r   Ú__init__ÚIsAttachedResult.__init__3   s   € ð 'ÔØ.ÔØ'>Ô$Ø.LÖ+r!   )r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r
   r   r   r   Úfieldsr&   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      sg   ø‡ € áØØàOô		
ñ 	ØØØØ7ô		
ñ 	Ø%ØØDô	
ñ
 	Ø,Øð8ô		
ð'€F÷:Mö Mr!   r   c                   ó*   € ] tR t^AtRtRtRtRtRtRt	R# )ÚContractExpiryStatusNÚactivezactive-soon-to-expirezgrace-periodÚexpired© )
r(   r)   r*   r+   ÚNONEÚACTIVEÚACTIVE_EXPIRED_SOONÚEXPIRED_GRACE_PERIODÚEXPIREDr-   r3   r!   r   r0   r0   A   s   † à€DØ€FØ1ÐØ)ÐØ„Gr!   r0   c          
      ó€   € V ^8„  d   QhR\         R\        R\        \        ,          R\        \
        \        3,          /# )r   ÚcfgÚis_machine_attachedÚremaining_daysÚreturn)r   r   r   r   r   r0   )r   s   "r   r   r   J   s?   € ÷ 7ñ 7Ü	ð7äð7ô œS•Mð7ô Ô¤Ð$Õ%ñ	7r!   c                ód  € V'       g   \         P                  ^ 3# \        p\        pVf   \         P                  V) 3# ^ Tu;8:  d   V8:  d   M M\         P
                  V3# V) Tu;8:  d   ^ 8  d   M M\         P                  V3# W#) 8  d   \         P                  V3# \         P                  V3# )z/Return a tuple [ContractExpiryStatus, num_days])r0   r4   r   r   r8   r6   r7   r5   )r:   r;   r<   Úgrace_periodÚpending_expirys   &&&  r   Ú_get_contract_expiry_statusrA   J   s¥   € ÷ Ü#×(Ñ(¨!Ð+Ð+ä4€LÜ1€Nð ÒÜ#×+Ñ+¨l¨]Ð:Ð:àˆNÖ,˜n×,Ü#×7Ñ7¸ÐGÐGØ
ˆ˜.Ö	,¨1×	,Ü#×8Ñ8¸.ÐHÐHØ	˜-Ô	'Ü#×+Ñ+¨^Ð;Ð;Ü×&Ñ&¨Ð6Ð6r!   c                ó$   € V ^8„  d   QhR\         /# )r   r=   )r   )r   s   "r   r   r   c   s   € ÷ $ñ $Ô%ñ $r!   c                  ó(   € \        \        4       4      # r#   )Ú_is_attachedr   r3   r!   r   r   r   c   s   € Üœ›
Ó#Ð#r!   c                ó0   € V ^8„  d   QhR\         R\        /# )r   r:   r=   )r   r   )r   s   "r   r   r   g   s   € ÷ ñ ”hð Ô#3ñ r!   c                óü   € \         P                  ! V 4      p\        VP                   4      p\        WVP                  4      w  r4RpV'       d   V\
        P                  8X  d   Rp\        VVP                  VVR7      # )zG
This endpoint shows if the machine is attached to a Pro subscription.
TFr$   )	r   Úget_machine_token_filer   rA   r   r0   r8   r   Úvalue)r:   Úmachine_token_filer;   r   r<   r   s   &     r   rD   rD   g   s   € ô '×=Ò=¸cÓBÐÜÐ1×?Ñ?Ó@Ðä&AØÐ"4×"LÑ"Ló'Ñ#€Oð &*Ð"çØÔ2×:Ñ:Ô:à).Ð&äØ'Ø'×-Ñ-Ø .Ø'Eô	ð r!   Úv1Ú
IsAttached)ÚversionÚnameÚfnÚoptions_clsÚintroduced_inÚ28Úrequires_networkFÚexample_pythonzZ
from uaclient.api.u.pro.status.is_attached.v1 import is_attached

result = is_attached()
Úresult_classÚ
exceptionsÚexample_cliz#pro api u.pro.status.is_attached.v1Úexample_jsonzŽ
{
    "contract_remaining_days": 360,
    "contract_status": "active",
    "is_attached": true,
    "is_attached_and_contract_valid": true
}
Úextraaò  
.. tab-item:: Explanation
    :sync: explanation

    The ``contract_status`` field can return 4 different states, they are:

    * **active**: The contract is currently valid.
    * **grace-period**: The contract is in the grace period. This means that
      it is expired, but there are still some days where the contract will be
      valid.
    * **active-soon-to-expire**: The contract is almost expired, but still
      valid.
    * **expired**: The contract is expired and no longer valid.
)ÚenumÚtypingr   r   Úuaclient.api.apir   Úuaclient.api.data_typesr   Úuaclient.configr   Úuaclient.data_typesr   r	   r
   r   r   Úuaclient.defaultsr   r   Úuaclient.filesr   r   ÚuniqueÚEnumr0   rA   r   rD   ÚendpointÚ_docr3   r!   r   Ú<module>re      sÃ   ðÛ ß "å (Ý 2Ý $÷õ ÷õ )ô)M�z >ô )MðX ‡�ô˜4Ÿ9™9ó ó ðõ7õ2$õñ4 ØØ	ØØô	€ð �TØ˜Øð ð
 Ð$Ø�"ØÐ8Øð ð ð ð'!‚r!   