
    Dj                       d Z ddlmZ ddlmZ ddlmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ  G d	 d
e          Z G d dee          Z G d dee          Z G d de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d!S )"zUser-facing Invites data transfer objects.

These types form the public API surface; users of :class:`InvitesService`
will receive and pass these. All are :class:`FrozenServiceModel` subclasses
(immutable, strictly validated).
    )annotations)datetime)EnumIntEnum)Optional)Field)FrozenServiceModel)SHARE_URL_PREFIXc                  "    e Zd ZdZdZdZdZdZdS )
RsvpStatuszCGuest's RSVP response state (encrypted ``status`` int on the wire).r            N)__name__
__module____qualname____doc__NO_RESPONSE	NOT_GOINGMAYBEGOING     _/home/thesage/.hermes/venv/lib/python3.11/site-packages/pyicloud/services/invites/models/dto.pyr   r      s(        MMKIEEEEr   r   c                      e Zd ZdZdZdZdZdS )ParticipantTypez3Type of participant on a ``cloudkit.share`` record.OWNERPUBLIC_USERUSERN)r   r   r   r   r   r   r   r   r   r   r   r      s#        ==EKDDDr   r   c                      e Zd ZdZdZdZdZdS )AcceptanceStatusz,Guest's acceptance status for an invitation.ACCEPTEDINVITEDREMOVEDN)r   r   r   r   r"   r#   r$   r   r   r   r!   r!   %   s#        66HGGGGr   r!   c                      e Zd ZdZdZdZdS )
EventScopez?Which CK database scope an event lives in for the current user.privatesharedN)r   r   r   r   PRIVATESHAREDr   r   r   r&   r&   -   s        IIGFFFr   r&   c                  H    e Zd ZU dZded<   dZded<   dZded	<   dZded
<   dS )	EventTimez&Decoded ``EventDetails.time`` payload.r   startNOptional[datetime]endFbool
is_all_dayis_open_ended)r   r   r   r   __annotations__r/   r1   r2   r   r   r   r,   r,   4   sT         00OOO"C""""JMr   r,   c                  v    e Zd ZU dZdZded<   dZded<   dZded<   dZded<   dZ	ded	<   dZ
ded
<   dZded<   dS )
EventPlacezDecoded ``EventDetails.place`` payload.

    All fields are optional. Events without a physical location may carry
    only ``city`` and ``time_zone_identifier``.
    NOptional[str]titlesubtitlecitytime_zone_identifierzOptional[float]latitude	longitudeurl)r   r   r   r   r7   r3   r8   r9   r:   r;   r<   r=   r   r   r   r5   r5   =   s            E"H""""D*..... $H$$$$!%I%%%%Cr   r5   c                  t    e Zd ZU dZded<   dZded<   dZded<   dZded<   dZded	<   d
ed<   ded<   ded<   dS )Participantz7A participant on the event's ``cloudkit.share`` record.strparticipant_idNr6   user_record_name
given_namefamily_nameemailr   typer!   acceptance_status
permission)	r   r   r   r   r3   rB   rC   rD   rE   r   r   r   r?   r?   M   s         AA&***** $J$$$$!%K%%%%E''''OOOOOr   r?   c                  R    e Zd ZU dZded<   ded<   dZded<   dZded	<   dZded
<   dS )OneTimeLinkGuestz5Guest invited via the email/phone one-time-link flow.r@   record_namerA    namer   tuple[str, ...]emailsphone_numbersN)r   r   r   r   r3   rM   rO   rP   r   r   r   rJ   rJ   Z   s_         ??DNNNN F    %'M''''''r   rJ   c                  j    e Zd ZU dZded<   ded<   dZded<   dZded	<   d
Zded<   edd            Z	d
S )
EventSharez-View of an event's ``cloudkit.share`` record.r@   
short_guidpublic_permissionr   ztuple[Participant, ...]participantsztuple[OneTimeLinkGuest, ...]one_time_linksNr6   current_user_participant_idreturnc                "    t            | j         S )zBPublic invite URL: ``https://www.icloud.com/invites/<shortGUID>``.)r
   rS   )selfs    r   r=   zEventShare.urlp   s     #5DO555r   )rX   r@   )
r   r   r   r   r3   rU   rV   rW   propertyr=   r   r   r   rR   rR   d   s         77OOO,.L....35N5555 2655556 6 6 X6 6 6r   rR   c                      e Zd ZU dZded<   ded<   dZded<   ded<   d	Zd
ed<   dZded<   dZded<   d	Z	d
ed<   d	Z
d
ed<   d	S )RsvpzA guest's RSVP response.r@   rK   rA   rL   rM   r   statusNr6   messager   intnum_additional_adultsnum_additional_kidsimage_download_urlrecord_change_tag)r   r   r   r   r3   rM   r_   ra   rb   rc   rd   r   r   r   r]   r]   v   s         ""DNNNN!G!!!!!"""""     (,,,,,'+++++++r   r]   c                  Z   e Zd ZU dZded<   ded<   dZded<   d	Zded
<   d	Zded<   d	Zded<   dZ	ded<   dZ
ded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<    ee          Zded<    ee          Zded<   d Zd!ed"<   dZd#ed$<   dZd#ed%<   dZd&ed'<   d Zd(ed)<   dS )*Eventz5An Invites event from the current user's perspective.r@   event_idr&   scopeNr6   rd   rL   r7   noteshost_display_nameFr0   is_published
is_privateis_cancelledblock_new_rsvpszOptional[int]max_attendeesr   r`   max_additional_guests_per_rsvpzOptional[EventTime]timezOptional[EventPlace]place)default_factorydict
backgroundstyler   rN   integrationsr.   created_timestampmodified_timestampzOptional[EventShare]shareztuple[Rsvp, ...]rsvps)r   r   r   r   r3   rd   r7   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   r   rt   ru   rv   rw   rx   ry   rz   r{   r   r   r   rf   rf      s        ??MMM'+++++EOOOOEOOOOLJL!O!!!!#'M''''*+"++++ $D$$$$"&E&&&&uT222J2222%---E----$&L&&&&,00000-11111"&E&&&& E      r   rf   c                      e Zd ZU dZded<   ded<   dZded<   dZded<   dZded	<   dZded
<   ded<   ded<   ded<   ded<   dS )ResolvedSharezAPreview returned by ``records/resolve`` before accepting a share.r@   rS   rg   Nr6   owner_record_nameowner_emailowner_given_nameowner_family_nameparticipant_statusparticipant_typeparticipant_permissionrR   rz   )	r   r   r   r   r3   r~   r   r   r   r   r   r   r}   r}      s         KKOOOMMM'+++++!%K%%%%&*****'+++++r   r}   N)r   
__future__r   r   enumr   r   typingr   pydanticr   pyicloud.common.modelsr	   $pyicloud.services.invites._constantsr
   r   r@   r   r!   r&   r,   r5   r?   rJ   rR   r]   rf   r}   r   r   r   <module>r      s    # " " " " "                           5 5 5 5 5 5 A A A A A A           c4       sD       d            "          #    
 
 
 
 
$ 
 
 
( ( ( ( () ( ( (6 6 6 6 6# 6 6 6$, , , , , , , ,! ! ! ! ! ! ! !4    &     r   