
    Ngd                         d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
mZ ddlmZ ddlmZ  G d d	e
          Z G d
 de          ZdS )zUtil that sends calendar events in Office 365.

Free, but setup is required. See link below.
https://learn.microsoft.com/en-us/graph/auth/
    )datetime)ListOptionalType)CallbackManagerForToolRun)	BaseModelField)O365BaseTool)
UTC_FORMATc                       e Zd ZU dZ edd          Zeed<    edd          Ze	e         ed<    edd          Z
eed	<    ed
          Zeed<    ed          Zeed<   dS )SendEventSchemazInput for CreateEvent Tool..z)The message body to include in the event.)descriptionbodyz$The list of attendees for the event.	attendeeszThe subject of the event.subjectug   The start datetime for the event in the following format:  YYYY-MM-DDTHH:MM:SS±hh:mm, where "T" separates the date and time  components, and the time zone offset is specified as ±hh:mm.  For example: "2023-06-09T10:30:00+03:00" represents June 9th,  2023, at 10:30 AM in a time zone with a positive offset of 3  hours from Coordinated Universal Time (UTC).start_datetimeue   The end datetime for the event in the following format:  YYYY-MM-DDTHH:MM:SS±hh:mm, where "T" separates the date and time  components, and the time zone offset is specified as ±hh:mm.  For example: "2023-06-09T10:30:00+03:00" represents June 9th,  2023, at 10:30 AM in a time zone with a positive offset of 3  hours from Coordinated Universal Time (UTC).end_datetimeN)__name__
__module____qualname____doc__r	   r   str__annotations__r   r   r   r   r        j/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain_community/tools/office365/send_event.pyr   r      s        %%?  D#    !5:  ItCy    5/  GS     %8  NC    8  L#     r   r   c                       e Zd ZU dZdZeed<   dZeed<   eZ	e
e         ed<   	 dded	ee         d
edededee         defdZdS )O365SendEventz/Tool for sending calendar events in Office 365.
send_eventnamezIUse this tool to create and send an event with the provided event fields.r   args_schemaNr   r   r   r   r   run_managerreturnc                    | j                                         }|                                }|                                }	||	_        ||	_        t          j        |t                    |	_	        t          j        |t                    |	_
        |D ]}
|	j                            |
           |	                                 dt          |	          z   }|S )NzEvent sent: )accountscheduleget_default_calendar	new_eventr   r   dtstrptimer   startendr   addsaver   )selfr   r   r   r   r   r"   r&   calendareventattendeeoutputs               r   _runzO365SendEvent._run;   s     <((**0022""$$
k.*==Kj99	! 	* 	*HO)))) 	

#e**,r   )N)r   r   r   r   r    r   r   r   r   r!   r   r   r   r   r4   r   r   r   r   r   2   s         99D#S     *9Ko&888 <@  9 	
   78 
     r   r   N)r   r   r)   typingr   r   r   langchain_core.callbacksr   pydanticr   r	   (langchain_community.tools.office365.baser
   )langchain_community.tools.office365.utilsr   r   r   r   r   r   <module>r:      s     $ # # # # # ' ' ' ' ' ' ' ' ' ' > > > > > > % % % % % % % % A A A A A A @ @ @ @ @ @    i   B# # # # #L # # # # #r   