
    =[j:                       d Z ddlmZ ddlZddlZddlZddlmZmZ ddlm	Z	m
Z
mZmZ ddlmZmZmZmZmZ ddlmZ dd	lmZmZ dd
lmZmZmZmZmZ ddlmZm Z m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,  G d d          Z-dS )z3Write-side orchestration for the Reminders service.    )annotationsN)datetimetimezone)AnyCallableDictOptional)CKModifyOperationCKModifyResponseCKRecordCKWriteParentCKWriteRecord   )_REMINDERS_ZONE_REQ)
AttachmentRemindersRecordMapper)
_as_raw_id_as_record_name_encode_cloudkit_text_field_encode_crdt_document_generate_resolution_token_map)_assert_modify_success_assert_read_success_refresh_record_change_tag_response_record_change_tag)	AlarmHashtagImageAttachmentLocationTrigger	ProximityRecurrenceFrequencyRecurrenceRuleReminderURLAttachmentc                     e Zd ZdZd|d
Zed}d            Zed~d            Zedddddddd&            Ze	dd'dd1            Z
edd7            Zeddd8dd?            ZddGZddLZddMZddRZddTZ	 	 	 	 	 	 	 	 ddd`ZddaZddbZdUdUdcdcddej        fddfZddiZddkZddlZ	 dddpZdddddddqddsZddtZej        dudWdWdvddwZ dddddvddzZ!dd{Z"dS )RemindersWriteAPIz9Encapsulates mutation behavior for the Reminders service.get_rawCallable[[], Any]mapperr   loggerlogging.LoggerreturnNonec                0    || _         || _        || _        d S N)_get_raw_mapper_logger)selfr'   r)   r*   s       k/home/thesage/.hermes/hermes-agent/venv/lib/python3.11/site-packages/pyicloud/services/reminders/_writes.py__init__zRemindersWriteAPI.__init__2   s          reminder_idstrc                "    t          | d          S )zFNormalize reminder IDs so writes accept shorthand and canonical forms.r#   )r   )r7   s    r4   _reminder_record_namez'RemindersWriteAPI._reminder_record_name<   s     {J777r6   
trigger_idalarm_idtitleaddresslatitudefloat	longituderadius	proximityr    location_uidr   c        	        2    t          | ||||||||	  	        S )z5Validate geofence data before sending a remote write.)	idr<   r=   r>   r?   rA   rB   rC   rD   )r   	r;   r<   r=   r>   r?   rA   rB   rC   rD   s	            r4   _validated_location_triggerz-RemindersWriteAPI._validated_location_triggerA   s6     %

 

 

 
	
r6   Nutifilename	file_sizewidthheight
attachmentr   rJ   Optional[str]rK   rL   Optional[int]rM   rN   c                  t          | j        | j        | j        || j        n||| j        nt          |          || j        nt          |          || j        nt          |          || j	        n|| j
        	  	        S )z>Validate image metadata updates before sending a remote write.N)	rF   r7   file_asset_urlrK   rL   rM   rN   rJ   record_change_tag)r   rF   r7   rS   rK   rL   intrM   rN   rJ   rT   )rO   rJ   rK   rL   rM   rN   s         r4   _validated_image_attachmentz-RemindersWriteAPI._validated_image_attachment[   s     }".%4,4,<Z(((.7.?j**S^^&+m*""U(.:$$CKK"%+
3(:

 

 

 
	
r6   )rT   recurrence_id	frequencyr!   intervalrU   occurrence_countfirst_day_of_weekrT   r"   c          	     p    t          t          |d          |                     |          |||||          S )z8Validate recurrence values before mutating remote state.r"   )rF   r7   rX   rY   rZ   r[   rT   )r"   r   r:   )clsrW   r7   rX   rY   rZ   r[   rT   s           r4   _validated_recurrence_rulez,RemindersWriteAPI._validated_recurrence_ruler   sI     }.>??11+>>-//
 
 
 	
r6   	completedboolcompleted_dateOptional[datetime]now_msc                    | sdS |#t          j        |dz  t          j                  S |j         |                    t          j                  S |S )zAResolve the completion timestamp to persist for a reminder write.N     @@tztzinfo)r   fromtimestampr   utcri   replacer_   ra   rc   s      r4   _completion_datetimez&RemindersWriteAPI._completion_datetime   s[      	4!)&6/hlKKKK (!)))>>>r6   )rT   parent_record_namerecord_namerecord_typefieldsDict[str, Any]ro   r   c                R    d}|rt          |          }t          | ||||          S )z-Build a typed CloudKit modify-record payload.N)
recordName)ru   
recordTyperecordChangeTagrr   parent)r   r   )rp   rq   rr   rT   ro   rx   s         r4   _write_recordzRemindersWriteAPI._write_record   sI      	B".@AAAF""-
 
 
 	
r6   reminderr#   
field_nametoken_field_nameraw_ids	list[str]r
   c                  t          t          j                    dz            }t          |dg          }|                     |j                  }t          d|                     |d|j        |d|ddd|dd	d
|di                    S )z7Build a Reminder update operation for an ID-list field.  lastModifiedDateupdater#   STRING_LISTtypevalueResolutionTokenMapSTRINGLastModifiedDate	TIMESTAMPrp   rq   rT   rr   operationTyperecord)rU   timer   r:   rF   r
   ry   rT   )r3   rz   r{   r|   r}   rc   	token_mapreminder_record_names           r4   _build_linked_ids_update_opz-RemindersWriteAPI._build_linked_ids_update_op   s     TY[[4'((212
 
	  $99(+FF "%%0&"*"< I I(8i*P*P&v(N(N	 & 	 	
 
 
 	
r6   operation_name	model_objr   r   c          	         t          d|                     ||||                    }|                                                     |gt                    }t          ||           t          |||           |S )zBRun a one-record update and refresh the local object's change tag.r   r   r   
operationszone_id)r
   ry   r0   modifyr   r   r   )	r3   r   rp   rq   rT   rr   r   opmodify_responses	            r4   _submit_single_record_updatez.RemindersWriteAPI._submit_single_record_update   s     "%%''"3	 &  
 
 
 --//00t' 1 
 
 	???"?I{KKKr6   c                :   |                                                      |gt                    }t          |j        d           |j        D ]>}t          |t                    r'|j        |k    r| j        	                    |          c S ?t          d|           )z0Fetch a freshly-created reminder by record name.)record_namesr   zLookup reminderzReminder not found: )r0   lookupr   r   records
isinstancer   ru   r1   record_to_reminderLookupError)r3   rp   resprecs       r4   _lookup_created_reminderz*RemindersWriteAPI._lookup_created_reminder   s    }}%%%' & 
 
 	T\+<===< 	< 	<C#x(( <S^{-J-J|66s;;;;;>>>???r6   reminder_ids_attrprefixchild_fieldstuple[str, CKModifyResponse]c          	     `   t          t          j                                                              }	 d|	 }
|                     |j                  }fdt          ||          pg D             }|                    |	           |                     ||||          }t          d| 
                    |
|||                    }|                                                     ||gt          d          }t          ||           t          |||           t!          |||           |
|fS )	z=Create a linked child record and update the reminder ID list./c                0    g | ]}t          |          S  r   ).0xr   s     r4   
<listcomp>z:RemindersWriteAPI._create_linked_child.<locals>.<listcomp>  s0     
 
 
&'Jq&!!
 
 
r6   rz   r{   r|   r}   createrp   rq   rr   ro   r   Tr   r   atomic)r8   uuiduuid4upperr:   rF   getattrappendr   r
   ry   r0   r   r   r   setattrr   )r3   rz   r   r   rq   r{   r|   r   r   
child_uuidchild_record_namer   
linked_idsreminder_opchild_opr   s      `            r4   _create_linked_childz&RemindersWriteAPI._create_linked_child   su    &&,,..
%44
44#99(+FF
 
 
 
,3H>O,P,P,VTV
 
 

 	*%%%66!-	 7 
 
 %"%%-'##7	 &  
 
 
 --//00#X.' 1 
 

 	???+Z888"?H>RSSS /11r6   childc               `   t          t          |d                    }	t          |	          |                     |j                  }
t          |dd          }|rF|                     |          |
k    r-t           d|	 d|                     |           d|
           fdt          ||          pg D             }|                     ||||          }d	d
ddi}|rd|                     |          ddd|d<   t          d|                     |	|t          |dd          |                    }| 	                                
                    ||gt          d          }t          ||           t          |||           t          |||
           t          |||	           dS )zBSoft-delete a linked child record and update the reminder ID list.rF   r7   Nz child z is linked to z, not c                X    g | ]&}t          |          k    t          |          'S r   r   )r   r   r   r   s     r4   r   z:RemindersWriteAPI._delete_linked_child.<locals>.<listcomp>?  sB     
 
 
!V$$
22 q&!!222r6   r   DeletedINT64r   r   	REFERENCEVALIDATEru   actionr#   r   rT   r   r   Tr   )r   r   r   r:   rF   
ValueErrorr   r
   ry   r0   r   r   r   r   r   )r3   rz   r   r   r   rq   r{   r|   r   r   r   child_reminder_idr   r   r   r   r   r   s       `            @r4   _delete_linked_childz&RemindersWriteAPI._delete_linked_child%  sU    ,GE4,@,@&II 16::
#99(+FF#E=$?? 	&&'899=QQQ * *"3 * *--.?@@* *'* *  
 
 
 
 
h(9::@b
 
 


 66!-	 7 
 
 !44(
  	#"&"<"<=N"O"O( ( (L$ %"%%-'")%1Dd"K"K#	 &  
 
 
 --//00#X.' 1 
 

 	???+Z888"?H>RSSS"?E;LMMMMMr6    Fr   list_iddescdue_datepriorityflaggedall_day	time_zoneparent_reminder_idc                   t          t          j                                                              }d| }t	          |          }t	          |          }g d}t          |          }t          t          j                    dz            }d|rdnddd|rdnddd|r|nd	dd|ddddd|rdndddddd|dd
|dddd|dd|dd|dd|dd}|Q|j         |	                    t          j                  }dt          |                                dz            d|d<   |	rd|	d|d<   |
rd
t          |
d          ddd|d<   t          d|                     |d||                    }|                                                     |gt$                    }t'          |d           |                     |          S )zDCreate a new Reminder inside a List, optionally as a child reminder.z	Reminder/)allDaytitleDocumentnotesDocumentparentReminderr   icsDisplayOrdercreationDatelistr   r_   completionDater   recurrenceRuleIDsdueDatetimeZoner   r   r   r   r   r   Nr   r   r   r   )AllDay	CompletedCompletionDateCreationDater   FlaggedImportedr   ListNotesDocumentPriorityr   TitleDocumentrh   DueDateTimeZoner#   ParentReminderr   r   r   r   zCreate reminder)r8   r   r   r   r   r   rU   r   ri   rl   r   rk   	timestampr   r
   ry   r0   r   r   r   r   )r3   r   r=   r   r_   r   r   r   r   r   r   reminder_uuidrp   	title_doc	notes_doc
fields_modr   rc   record_fieldsr   r   s                        r4   r   zRemindersWriteAPI.createl  s    DJLL))//111-11)%00	)$//	
 
 

" 3:>>	TY[[4'((  'g1D1EE")4IAAJJ##,6$  &16BB '!44 'w2E!!AFF!(155)4v F F#(/:FF  '/CC!(8<<+3i"H"H&.CC')
 )
, &#++8<+@@#X//11D899( (M)$
  	O19I(N(NM*% 	#"12Dj"Q"Q( / /M*+ "%%'&$#*	 &  
 
 
 --//00t' 1 
 
 	0ABBB,,[999r6   c           
        |                      |j                  }t          |j                  }t          |j        pd          }t          t          j                    dz            }g d}|                     |j        |j	        |          }|$t          |
                                dz            nd}d|dd|dd|j        rd	nd
dd|dd|j        dd|j        rd	nd
dd|j        rd	nd
dd|dd}	|j        `|j        }
|
j        '|
                    t"          j                  }
|
|_        dt          |

                                dz            d|	d<   nddd|	d<   |                    d           |j        rd|j        d|	d<   nddd|	d<   |                    d           |j        rdt-          |j        d          ddd|	d<   nddd|	d<   |                    d           dt/          |          d|	d<   |                     d|d|j        |	|           ||_	        t5          j        |dz  t"          j                  |_        dS )zUpdate an existing reminder.r   r   )r   r   r_   r   r   r   r   r   rm   Nr   r   r   r   r   r   )r   r   r   r   r   r   r   r   rh   r   r   r   r   r   r#   r   r   r   r   r   zUpdate reminderr   rp   rq   rT   rr   r   re   rf   )r:   rF   r   r=   r   rU   r   rn   r_   ra   r   r   r   r   r   ri   rl   r   rk   r   r   r   r   r   r   rT   r   rj   modified)r3   rz   r   r   r   rc   r   completion_datecompletion_date_msrr   r   s              r4   r   zRemindersWriteAPI.update  s*   #99(+FF)(.99	)(-*=2>>	TY[[4'((	
 	
 	

 33(#2 4 
 
 * ))++d2333 	 '/CC&.CC")9K4RAAQRSS#+  ")83DEE 'x7G2N!!QOO&h6F1MANN)4v F F"
 "
 ((H&#++8<+@@$,!#X//11D899! !F9
 *5t D DF9)$$$ 	C*2X=O!P!PF:*2T!B!BF:*%%%& 	L#"1 3"# # ) 	( 	(F#$$ 1<d'K'KF#$*+++3J??(
 (
#$
 	)),,"&8 	* 	
 	
 	
 #2$26F?x|TTTr6   c                b   |                      |j                  }ddg}t          |          }t          t	          j                    dz            }dddd|dd|dd	}|                     d
|d|j        ||           d|_        t          j	        |dz  t          j                  |_        dS )z1Delete a reminder using soft-update (Deleted: 1).deletedr   r   r   r   r   r   r   )r   r   r   zDelete reminderr#   r   Tre   rf   N)r:   rF   r   rU   r   r   rT   r   r   rj   r   rk   r   )r3   rz   r   r   r   rc   rr   s          r4   deletezRemindersWriteAPI.delete(  s    #99(+FF!34
2:>>	TY[[4'(( !(!44+3i"H"H)4v F F"
 "
 	)),,"&8 	* 	
 	
 	
  $26F?x|TTTr6   g        g      Y@tuple[Alarm, LocationTrigger]c                   t          t          j                                                              }t          t          j                                                              }	t          t          j                                                              }
d| }d|	 }|                     |j                  }t          t          j                    dz            }t          j                    dz
  }d|z   }|                     |||||||||
	  	        }d t          |j
        pg           D             }|                    |           t          dd	g          }t          d
|                     |d|j        d|dd|dd|dd                    }t          d|                     |d|ddddddddd|ddd|	dd|ddd|                    }t          d|                     |d|ddd d|dddddd|j        ddd |
dd|j        ddd t          |j                  dd|j        ddd!ddd |j        ddd d"ddd#|                    }|                                                     |||gt.          d$          }t1          |d%           ||_
        t3          |||           t5          ||||	t7          ||          &          }t7          ||          |_        ||fS )'z>Attach a location-based alarm trigger to an existing Reminder.zAlarm/zAlarmTrigger/r   g   @'Al    h] rG   c                .    g | ]}t          |d           S )r   r   )r   r   s     r4   r   z:RemindersWriteAPI.add_location_trigger.<locals>.<listcomp>a  s/     
 
 
'(Jq'""
 
 
r6   alarmIDsr   r   r#   r   r   r   r   )AlarmIDsr   r   r   r   r   r   )r   r   r   r   r   r   r   DOUBLE)AlarmUIDr   r   r#   	TriggerIDDueDateResolutionTokenAsNoncer   AlarmTriggerT)r   isEncryptedr   1Location)Addressr   r   LatitudeLocationUID	Longituder    RadiusReferenceFrameStringTitleTyper   zAdd location trigger)rF   	alarm_uidr7   r;   rT   )r8   r   r   r   r:   rF   rU   r   rH   r   	alarm_idsr   r   r
   ry   rT   r?   rA   rC   rB   r=   r0   r   r   r   r   r   r   )r3   rz   r=   r>   r?   rA   rB   rC   
alarm_uuidtrigger_uuidrD   alarm_record_nametrigger_record_namer   rc   apple_epoch_secsdue_date_noncetriggerexisting_alarm_idsr   r   alarm_op
trigger_opr   alarms                            r4   add_location_triggerz&RemindersWriteAPI.add_location_trigger@  s8    &&,,..
4:<<((..004:<<((..001Z11<l<<#99(+FFTY[[4'((9;;4(+;;22*&% 3 

 


 
,01C1Ir,J,J
 
 
 	!!*---2J@R3STT	'"%%0&"*"<)6AS T T3;i*P*P1<v(N(N 	 & 	 	
 
 
 %"%%-#*4h G G)*G<<*+W = = +*>&0" "! ! ,8!J!J!/ (6 6 " $8) &  
 
 
4 '"%%/* ")'+ (    !,*;&0" "  *+G<<!(!1'+ (! !
 .:8#L#L!(!2'+ (" "
 ,/w/@+A+A7!S!S(/II!$'+ (- - ")'+ ( 
 '1(CCK& &N $5U & + +.
 .
 .

` --//00#Xz:' 1 
 

 	0FGGG/"?H>RSSS  ,#9! 	
 	
 	
 %@%
 %
! g~r6   namer   c                :   t          t          j                    dz            }|                     |j                  }|                     |dddddt          |          dddd	|d
ddd|ddd          \  }}t          |||t          ||                    S )zECreate a hashtag linked to a reminder and update Reminder.HashtagIDs.r   hashtag_idsr   
HashtagIDs
hashtagIDsr   r   r   r   r   r   r   )Namer   r#   r   zCreate hashtagrz   r   r   rq   r{   r|   r   r   )rF   r#  r7   rT   )rU   r   r:   rF   r   r   r   r   )r3   rz   r#  rc   r   hashtag_record_namer   s          r4   create_hashtagz RemindersWriteAPI.create_hashtag  s    TY[[4'((#99(+FF/3/H/H+!#)3D99$+a88'&:",   *5v F F  ,' 0I 0
 0
,_* ",9# 	
 
 
 	
r6   hashtagc                    dt          |          i}|j        r#d|                     |j                  ddd|d<   t          |j        d          }|                     d|d|j        ||	           ||_        d
S )z Update an existing hashtag name.r(  r   r   r   r   r#   r   zUpdate hashtagr   N)r   r7   r:   r   rF   r   rT   r#  )r3   r,  r#  rr   r*  s        r4   update_hashtagz RemindersWriteAPI.update_hashtag  s     /55"
  	#"&"<"<W=P"Q"Q( " "F: .gj)DD))++!%7 	* 	
 	
 	
 r6   c           
     @    |                      |d|ddddd           dS )z=Soft-delete a hashtag and remove it from Reminder.HashtagIDs.r%  r   r&  r'  zDelete hashtagrz   r   r   r   rq   r{   r|   r   Nr   )r3   rz   r,  s      r4   delete_hashtagz RemindersWriteAPI.delete_hashtag  sA    !!+!#)+ 	" 		
 		
 		
 		
 		
r6   
public.urlurlr$   c                    |                      |j                  }|                     |ddddddddd|d	d
dd|ddd|ddddddddd          \  }}t          ||||t	          ||                    S )z@Create a URL attachment and link it from Reminder.AttachmentIDs.attachment_idsr   AttachmentIDsattachmentIDsr   URLr   r   r   r   Tr   r   r
  r   r   )r  r#   r9  UTIr   r   zCreate attachmentr)  )rF   r7   r4  rJ   rT   )r:   rF   r   r$   r   )r3   rz   r4  rJ   r   attachment_record_namer   s          r4   create_url_attachmentz'RemindersWriteAPI.create_url_attachment!  s      $99(+FF262K2K.$&,!)E::'&:",   % #' 
 !)377%,q99$+a88! $ /3 3L 3
 3
/6 %,9& 	
 	
 	
 		
r6   )r4  rJ   rK   rL   rM   rN   r   c                  i }t          |t                    r7|dup|du}	|	st          d          |	d|dd|d<   |d|d|d<   ddd|d	<   nt          d
 |||||fD                       }	|	st          d          |                     ||||||          }
|d|d|d<   |d|d|d<   |dt          |          d|d<   |dt          |          d|d<   |dt          |          d|d<   ddd|d	<   |j        r#d|                     |j                  ddd|d<   t          |j	        d          }| 
                    d|d|j        ||           t          |t                    r|||_        |	||_        dS dS |
j        |_        |
j        |_        |
j        |_        |
j        |_        |
j        |_        dS )zBUpdate an attachment record (URL fields or image metadata fields).Nz(No attachment fields provided for updater   Tr:  r9  r   r;  r  c              3     K   | ]}|d uV  	d S r/   r   r   r   s     r4   	<genexpr>z6RemindersWriteAPI.update_attachment.<locals>.<genexpr>k  s8        &+T!     r6   rI   FileNamer   FileSizeWidthHeightImager   r   r   r#   r   zUpdate attachmentr   )r   r$   r   anyrV   rU   r7   r:   r   rF   r   rT   r4  rJ   rK   rL   rM   rN   )r3   rO   r4  rJ   rK   rL   rM   rN   rr   has_mutationvalidated_attachmentr<  s               r4   update_attachmentz#RemindersWriteAPI.update_attachmentO  s    "$j-00 %	Bd?=coL M !KLLL$ #'! !u
 )1C @ @u&.??F6NN  03Xy%QW/X    L   M !KLLL#'#C#C!# $D $ $  )1C @ @u#.6%J%Jz"$.5I%O%Oz" +2SZZ"H"Hw!,3c&kk#J#Jx &.AAF6N! 	#"&"<"<Z=S"T"T( " "F: "1!M!M))..$(:  	* 	
 	
 	
 j-00 
	<!$
!$
  25JN"6"?J#7#AJ 39J 4 ;Jr6   c           
     @    |                      |d|ddddd           dS )zDSoft-delete an attachment and unlink it from Reminder.AttachmentIDs.r6  r   r7  r8  zDelete attachmentr0  Nr1  )r3   rz   rO   s      r4   delete_attachmentz#RemindersWriteAPI.delete_attachment  sA    !!.$&,. 	" 		
 		
 		
 		
 		
r6   r   )rX   rY   rZ   r[   c                  |                      d|j        ||||          }|                     |j                  }|                     |dddddd|dd	d
dt	          |j                  d
dt	          |j                  d
dt	          |j                  d
dt	          |j                  d
ddd
ddd
dd          \  }}	||_        ||_	        t          |	|          |_        |S )zECreate a recurrence rule and link it from Reminder.RecurrenceRuleIDs.zRecurrenceRule/NEW)rW   r7   rX   rY   rZ   r[   recurrence_rule_idsr"   RecurrenceRuleIDsr   r   r   r   r   r   r   )r#   	FrequencyIntervalOccurrenceCountFirstDayOfTheWeekr   r   zCreate recurrence ruler)  )r^   rF   r:   r   rU   rX   rY   rZ   r[   r7   r   rT   )
r3   rz   rX   rY   rZ   r[   validated_ruler   recurrence_record_namer   s
             r4   create_recurrence_rulez(RemindersWriteAPI.create_recurrence_rule  sc    88. -/ 9 
 
  $99(+FF262K2K3#(*0 (&:",   $ !9::  &-s>;R7S7STT# !@AA$ $
 $ !ABB& & &-q99$+a88- 0 4? 3L  3
  3
/B 3%9"+F",
 ,
( r6   recurrence_ruleOptional[RecurrenceFrequency]c          	        i }t          d ||||fD                       }|st          d          |                     |j        |j        |p|j        ||j        n|||j        n|||j        n||j	                  }|dt          |          d|d<   |dt          |          d|d<   |dt          |          d|d	<   |dt          |          d|d
<   |j        r#d|                     |j                  ddd|d<   t          |j        d          }	|                     d|	d|j	        ||           |j        |_        |j        |_        |j        |_        |j        |_        dS )z#Update an existing recurrence rule.c              3     K   | ]}|d uV  	d S r/   r   r@  s     r4   rA  z;RemindersWriteAPI.update_recurrence_rule.<locals>.<genexpr>  s;       
 
 
 
 
 
 
 
r6   z-No recurrence rule fields provided for updateN)rW   r7   rX   rY   rZ   r[   rT   r   r   rP  rQ  rR  rS  r   r   r   r#   r"   zUpdate recurrence ruler   )rG  r   r^   rF   r7   rX   rY   rZ   r[   rT   rU   r:   r   r   )
r3   rW  rX   rY   rZ   r[   rr   rH  rT  rU  s
             r4   update_recurrence_rulez(RemindersWriteAPI.update_recurrence_rule  s    "$ 
 
#X/?ARS
 
 
 
 
  	NLMMM88),'3<?#<191A_--x $+  00% %,  11&-? 9 
 
$  +2S^^"L"LF;*1CMM!J!JF:'-..) )F$% (.//+ +F&' & 		#"&"<"<'3# # )	 " "F: "11CEU!V!V))3.(-?% 	* 	
 	
 	
 %3$<!#1#: +9+J(,:,L)))r6   c           
     @    |                      |d|ddddd           dS )z>Soft-delete a recurrence rule and unlink it from the reminder.rN  r"   rO  r   zDelete recurrence ruler0  Nr1  )r3   rz   rW  s      r4   delete_recurrence_rulez(RemindersWriteAPI.delete_recurrence_rule7  sC     	!!3!#(*03 	" 		
 		
 		
 		
 		
r6   )r'   r(   r)   r   r*   r+   r,   r-   )r7   r8   r,   r8   )r;   r8   r<   r8   r=   r8   r>   r8   r?   r@   rA   r@   rB   r@   rC   r    rD   r8   r,   r   )rO   r   rJ   rP   rK   rP   rL   rQ   rM   rQ   rN   rQ   r,   r   )rW   r8   r7   r8   rX   r!   rY   rU   rZ   rU   r[   rU   rT   rP   r,   r"   )r_   r`   ra   rb   rc   rU   r,   rb   )rp   r8   rq   r8   rr   rs   rT   rP   ro   rP   r,   r   )
rz   r#   r{   r8   r|   r8   r}   r~   r,   r
   )r   r8   rp   r8   rq   r8   rT   rP   rr   rs   r   r   r,   r   )rp   r8   r,   r#   )rz   r#   r   r8   r   r8   rq   r8   r{   r8   r|   r8   r   rs   r   r8   r,   r   )rz   r#   r   r8   r   r   r   r8   rq   r8   r{   r8   r|   r8   r   r8   r,   r-   )r   FNr   FFNN)r   r8   r=   r8   r   r8   r_   r`   r   rb   r   rU   r   r`   r   r`   r   rP   r   rP   r,   r#   )rz   r#   r,   r-   )rz   r#   r=   r8   r>   r8   r?   r@   rA   r@   rB   r@   rC   r    r,   r   )rz   r#   r#  r8   r,   r   )r,  r   r#  r8   r,   r-   )rz   r#   r,  r   r,   r-   )r3  )rz   r#   r4  r8   rJ   r8   r,   r$   )rO   r   r4  rP   rJ   rP   rK   rP   rL   rQ   rM   rQ   rN   rQ   r,   r-   )rz   r#   rO   r   r,   r-   )rz   r#   rX   r!   rY   rU   rZ   rU   r[   rU   r,   r"   )rW  r"   rX   rX  rY   rQ   rZ   rQ   r[   rQ   r,   r-   )rz   r#   rW  r"   r,   r-   )#__name__
__module____qualname____doc__r5   staticmethodr:   rH   rV   classmethodr^   rn   ry   r   r   r   r   r   r   r   r   r    ARRIVINGr"  r+  r.  r2  r=  rJ  rL  r!   DAILYrV  r[  r]  r   r6   r4   r&   r&   /   sf       CC    8 8 8 \8 
 
 
 \
2  ""&#'# $
 
 
 
 
 \
,  ,0
 
 
 
 
 [
,    \  ,0,0
 
 
 
 
 \
*
 
 
 
8   8@ @ @ @.2 .2 .2 .2`EN EN EN ENV '+#',0b: b: b: b: b:HVU VU VU VUpU U U U6 (1V V V V Vp!
 !
 !
 !
F   2
 
 
 
"  	,
 ,
 ,
 ,
 ,
d "!"&#'# $R< R< R< R< R< R<h
 
 
 
" *=)B !!": : : : : :@ 48"&*.+/IM IM IM IM IM IMV
 
 
 
 
 
r6   r&   ).ra  
__future__r   loggingr   r   r   r   typingr   r   r   r	   pyicloud.common.cloudkitr
   r   r   r   r   
_constantsr   _mappersr   r   	_protocolr   r   r   r   r   _supportr   r   r   r   modelsr   r   r   r   r    r!   r"   r#   r$   r&   r   r6   r4   <module>ro     s   9 9 " " " " " "    ' ' ' ' ' ' ' ' 0 0 0 0 0 0 0 0 0 0 0 0              , + + + + + 7 7 7 7 7 7 7 7                        
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
W
 W
 W
 W
 W
 W
 W
 W
 W
 W
r6   