
    F2j|                     2   d dl Z d dlmZmZ d dlmZ d dlmZ ddlmZm	Z	m
Z
 ej        Zd Z G d d	e          Z G d
 de          Z G d de          Z G d de          Z G d de          Z G d de	          Z G d de	          Z G d de	          Z G d de
          Z G d de          Z G d de          Z G d de          Z G d  d!e          Z G d" d#e	          Z G d$ d%e          Z G d& d'e          Z G d( d)e          Z G d* d+e          Z G d, d-e
          Z  G d. d/e
          Z! G d0 d1e
          Z" G d2 d3e
          Z# G d4 d5e
          Z$ G d6 d7e
          Z% G d8 d9e
          Z& G d: d;e
          Z' G d< d=e
          Z( G d> d?e          Z) G d@ dAe          Z* G dB dCe          Z+ G dD dEe          Z, G dF dGe          Z- G dH dIe          Z. G dJ dKe          Z/ G dL dMe          Z0dS )N    N)datetimetimezone)ClassVar)ns   )BaseElementNamedBaseElementValuedBaseElementc                    t          | t                    r=	 |                     t                    } n # t          t
          t          f$ r ddl}|                     |	                                          } t          j
                            t                    }t          j                            t                    }|| j                            |           z   | k    rt          j        d|            |} nS| || j                            |           z
  k    rt          j        d|            |} n|                     t                    } Y nw xY w|                     d          S )z>coerce datetimes to UTC (assume localtime if nothing is given)r   N)tzinfoz6Cannot coerce datetime %s to UTC. Changed to min-date.z6Cannot coerce datetime %s to UTC. Changed to max-date.z%Y%m%dT%H%M%SZ)
isinstancer   
astimezoneutc_tzOverflowErrorOSError
ValueErrortzlocalreplaceget_localzoneminmaxr   	utcoffsetloggingerrorstrftime)tsr   mindatemaxdates       \/home/thesage/.hermes/hermes-agent/venv/lib/python3.11/site-packages/caldav/elements/cdav.py_to_utc_date_stringr       sJ    "h +	+
 v&&BBw
3 	+ 	+ 	+ NNN7#8#8#:#:;;Bl**&*99Gl**&*99G,,R000255VXZ[[[g	 3 3B 7 7777VXZ[[[]]6**!	+$ ;;'(((s   4 DEEc                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarQueryCzcalendar-querytagN__name__
__module____qualname__r   r$   r   str__annotations__     r   r"   r"   0   3         C!122C#22222r,   r"   c                   >    e Zd ZU  edd          Zee         ed<   dS )FreeBusyQueryr#   zfree-busy-queryr$   Nr%   r+   r,   r   r/   r/   4   s3         C!233C#33333r,   r/   c                   >    e Zd ZU  edd          Zee         ed<   dS )
Mkcalendarr#   
mkcalendarr$   Nr%   r+   r,   r   r1   r1   8   s2         C..C#.....r,   r1   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarMultiGetr#   zcalendar-multigetr$   Nr%   r+   r,   r   r4   r4   <   3         C!455C#55555r,   r4   c                   >    e Zd ZU  edd          Zee         ed<   dS )Filterr#   filterr$   Nr%   r+   r,   r   r7   r7   A   s2         C**C#*****r,   r7   c                   >    e Zd ZU  edd          Zee         ed<   dS )
CompFilterr#   zcomp-filterr$   Nr%   r+   r,   r   r:   r:   E   2         C//C#/////r,   r:   c                   >    e Zd ZU  edd          Zee         ed<   dS )
PropFilterr#   zprop-filterr$   Nr%   r+   r,   r   r=   r=   I   r;   r,   r=   c                   >    e Zd ZU  edd          Zee         ed<   dS )ParamFilterr#   zparam-filterr$   Nr%   r+   r,   r   r?   r?   M   2         C00C#00000r,   r?   c                   ^     e Zd ZU  edd          Zee         ed<   ddededd	f fd
Z	 xZ
S )	TextMatchr#   z
text-matchr$   i;octetF	collationnegatereturnNc                     t                                          |           | j        t          d          || j        d<   |rd| j        d<   d S d S )N)value)Unexpected value None for self.attributesrD   yesznegate-condition)super__init__
attributesr   )selfrH   rD   rE   	__class__s       r   rL   zTextMatch.__init__U   sf    u%%%?"HIII'0$ 	827DO.///	8 	8r,   )rC   F)r&   r'   r(   r   r$   r   r)   r*   boolrL   __classcell__rO   s   @r   rB   rB   R   sz         C..C#...8 8 8$ 8SW 8 8 8 8 8 8 8 8 8 8r,   rB   c                   j     e Zd ZU  edd          Zee         ed<   d	dedz  dedz  ddf fdZ	 xZ
S )
	TimeRanger#   z
time-ranger$   NstartendrF   c                     t                                                       | j        t          d          |t	          |          | j        d<   |t	          |          | j        d<   d S d S NrI   rU   rV   rK   rL   rM   r   r    rN   rU   rV   rO   s      r   rL   zTimeRange.__init__c   sr     	?"HIII':5'A'ADOG$?%8%=%=DOE""" ?r,   )NNr&   r'   r(   r   r$   r   r)   r*   r   rL   rQ   rR   s   @r   rT   rT   `   s         C..C#...> >ho >8d? >VZ > > > > > > > > > >r,   rT   c                   >    e Zd ZU  edd          Zee         ed<   dS )
NotDefinedr#   zis-not-definedr$   Nr%   r+   r,   r   r]   r]   q   r-   r,   r]   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarDatar#   zcalendar-datar$   Nr%   r+   r,   r   r_   r_   v   2         C11C#11111r,   r_   c                   j     e Zd ZU  edd          Zee         ed<   d	dedz  dedz  ddf fdZ	 xZ
S )
Expandr#   expandr$   NrU   rV   rF   c                     t                                                       | j        t          d          |t	          |          | j        d<   |t	          |          | j        d<   d S d S rX   rY   rZ   s      r   rL   zExpand.__init__}   sp    ?"HIII':5'A'ADOG$?%8%=%=DOE""" ?r,   )Nr[   rR   s   @r   rb   rb   z   s         C**C#***	> 	>ho 	>HtO 	>t 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>r,   rb   c                   >    e Zd ZU  edd          Zee         ed<   dS )Compr#   compr$   Nr%   r+   r,   r   rf   rf      s0         CC#(((((r,   rf   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarUserAddressSetr#   zcalendar-user-address-setr$   Nr%   r+   r,   r   ri   ri      s3         C!<==C#=====r,   ri   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarUserTyper#   zcalendar-user-typer$   Nr%   r+   r,   r   rk   rk      3         C!566C#66666r,   rk   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarHomeSetr#   zcalendar-home-setr$   Nr%   r+   r,   r   rn   rn      r5   r,   rn   c                   >    e Zd ZU  edd          Zee         ed<   dS )Calendarr#   calendarr$   Nr%   r+   r,   r   rp   rp      s2         C,,C#,,,,,r,   rp   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarDescriptionr#   zcalendar-descriptionr$   Nr%   r+   r,   r   rs   rs      s3         C!788C#88888r,   rs   c                   >    e Zd ZU  edd          Zee         ed<   dS )CalendarTimeZoner#   zcalendar-timezoner$   Nr%   r+   r,   r   ru   ru      r5   r,   ru   c                   >    e Zd ZU  edd          Zee         ed<   dS )SupportedCalendarComponentSetr#   z supported-calendar-component-setr$   Nr%   r+   r,   r   rw   rw      s3         C!CDDC#DDDDDr,   rw   c                   >    e Zd ZU  edd          Zee         ed<   dS )SupportedCalendarDatar#   zsupported-calendar-datar$   Nr%   r+   r,   r   ry   ry      s3         C!:;;C#;;;;;r,   ry   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxResourceSizer#   zmax-resource-sizer$   Nr%   r+   r,   r   r{   r{      r5   r,   r{   c                   >    e Zd ZU  edd          Zee         ed<   dS )MinDateTimer#   zmin-date-timer$   Nr%   r+   r,   r   r}   r}      r`   r,   r}   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxDateTimer#   zmax-date-timer$   Nr%   r+   r,   r   r   r      r`   r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxInstancesr#   zmax-instancesr$   Nr%   r+   r,   r   r   r      r`   r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )MaxAttendeesPerInstancer#   zmax-attendees-per-instancer$   Nr%   r+   r,   r   r   r      s3         C!=>>C#>>>>>r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )Allpropr#   allpropr$   Nr%   r+   r,   r   r   r      s2         C++C#+++++r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleTagr#   zschedule-tagr$   Nr%   r+   r,   r   r   r      r@   r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleInboxURLr#   zschedule-inbox-URLr$   Nr%   r+   r,   r   r   r      rl   r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleOutboxURLr#   zschedule-outbox-URLr$   Nr%   r+   r,   r   r   r      s3         C!677C#77777r,   r   c                   >    e Zd ZU  edd          Zee         ed<   dS )ScheduleResponser#   zschedule-responser$   Nr%   r+   r,   r   r   r      r5   r,   r   c                   B    e Zd ZU dZ edd          Zee         ed<   dS )Responsezc
    https://datatracker.ietf.org/doc/html/rfc6638#section-10.2
    Child of schedule-response
    r#   responser$   N	r&   r'   r(   __doc__r   r$   r   r)   r*   r+   r,   r   r   r      s>          
 C,,C#,,,,,r,   r   c                   B    e Zd ZU dZ edd          Zee         ed<   dS )	RecipientzZ
    https://datatracker.ietf.org/doc/html/rfc6638#section-10.3
    Child of response
    r#   	recipientr$   Nr   r+   r,   r   r   r      s>          
 C--C#-----r,   r   c                   B    e Zd ZU dZ edd          Zee         ed<   dS )RequestStatuszZ
    https://datatracker.ietf.org/doc/html/rfc6638#section-10.4
    Child of response
    r#   zrequest-statusr$   Nr   r+   r,   r   r   r      s?          
 C!122C#22222r,   r   )1r   r   r   typingr   caldav.lib.namespacer   baser   r	   r
   utcr   r    r"   r/   r1   r4   r7   r:   r=   r?   rB   rT   r]   r_   rb   rf   ri   rk   rn   rp   rs   ru   rw   ry   r{   r}   r   r   r   r   r   r   r   r   r   r   r   r+   r,   r   <module>r      s]    ' ' ' ' ' ' ' '       # # # # # # B B B B B B B B B B	) ) )F3 3 3 3 3K 3 3 34 4 4 4 4K 4 4 4/ / / / / / / /6 6 6 6 6{ 6 6 6
+ + + + +[ + + +0 0 0 0 0! 0 0 00 0 0 0 0! 0 0 01 1 1 1 1" 1 1 1
8 8 8 8 8! 8 8 8> > > > > > > >"3 3 3 3 3 3 3 3
2 2 2 2 2; 2 2 2> > > > >[ > > >) ) ) ) ) ) ) )
> > > > >[ > > >7 7 7 7 7{ 7 7 76 6 6 6 6k 6 6 6
- - - - -{ - - -9 9 9 9 9+ 9 9 96 6 6 6 6( 6 6 6E E E E E$5 E E E< < < < <- < < <6 6 6 6 6' 6 6 62 2 2 2 2# 2 2 22 2 2 2 2# 2 2 22 2 2 2 2$ 2 2 2? ? ? ? ?/ ? ? ?, , , , ,k , , ,1 1 1 1 1+ 1 1 17 7 7 7 7{ 7 7 78 8 8 8 8 8 8 86 6 6 6 6{ 6 6 6- - - - -{ - - -. . . . . . . .3 3 3 3 3K 3 3 3 3 3r,   