o
    ,ÂifL	  ã                   @   sŒ   d dl mZmZ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 d dlmZ er6d dlmZ ed	ƒZG d
d„ dee ƒZdS )é    )ÚTYPE_CHECKINGÚOptionalÚTypeVar)ÚSelf)ÚClientObject)ÚResourcePath)Ú
EntityPath)ÚDeleteEntityQuery)ÚUpdateEntityQuery)ÚGraphClientÚTc                       sb   e Zd ZdZdd„ Zdd„ Zedd„ ƒZedd	„ ƒZed
d„ ƒZ	edd„ ƒZ
d‡ fdd„	Z‡  ZS )ÚEntityzBase entityc                 C   s   t | ƒ}| j |¡ | S )zUpdates the entity.)r
   ÚcontextÚ	add_query©ÚselfÚqry© r   úI/var/www/html/corbot_env/lib/python3.10/site-packages/office365/entity.pyÚupdate   s   zEntity.updatec                 C   s    t | ƒ}| j |¡ |  ¡  | S )zDeletes the entity.)r	   r   r   Úremove_from_parent_collectionr   r   r   r   Údelete_object   s   zEntity.delete_objectc                 C   s   | j S )z Return the Graph Client context.)Ú_context©r   r   r   r   r   $   s   zEntity.contextc                 C   s8   | j d u rt| ƒj}d|d  ¡  |dd …  | _ | j S )Nzmicrosoft.graph.r   é   )Ú_entity_type_nameÚtypeÚ__name__Úlower)r   Únamer   r   r   Úentity_type_name*   s   

zEntity.entity_type_namec                 C   s   | j  dd¡S )z$The unique identifier of the entity.ÚidN)Ú
propertiesÚgetr   r   r   r   r!   2   s   z	Entity.idc                 C   s   dS )Nr!   r   r   r   r   r   Úproperty_ref_name8   s   zEntity.property_ref_nameTc                    sn   t t| ƒ |||¡ || jkr5| jd u r/t| jjtƒr%| jj 	|¡| _| S t
|| jjƒ| _| S | j 	|¡ | S )N)Úsuperr   Úset_propertyr$   Ú_resource_pathÚ
isinstanceÚparent_collectionÚresource_pathr   Úpatchr   )r   r   ÚvalueÚpersist_changes©Ú	__class__r   r   r&   =   s   

ÿ	ûÿÿzEntity.set_property)T)r   Ú
__module__Ú__qualname__Ú__doc__r   r   Úpropertyr   r    r!   r$   r&   Ú__classcell__r   r   r.   r   r      s    



r   N)Útypingr   r   r   Útyping_extensionsr   Úoffice365.runtime.client_objectr   Ú%office365.runtime.paths.resource_pathr   Ú!office365.runtime.paths.v4.entityr   Ú'office365.runtime.queries.delete_entityr	   Ú'office365.runtime.queries.update_entityr
   Úoffice365.graph_clientr   r   r   r   r   r   r   Ú<module>   s    