def update_item(event, updated_attributes, calendar_item_update_operation_type):
root = M.UpdateItem(<EOL>M.ItemChanges(<EOL>T.ItemChange(<EOL>T.ItemId(Id=event.id, ChangeKey=event.change_key),<EOL>T.Updates()<EOL>)<EOL>),<EOL>ConflictResolution=u"<STR_LIT>",<EOL>MessageDisposition=u"<STR_LIT>",<EOL>SendMeetingInvitationsOrCancellations=calendar_item_update_operation_type<EOL>)<EOL>update_node = root.xpath(u'<STR_LIT>', namespaces=NAMESPACES)[<NUM_LIT:0>]<EOL>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.Body(event.html_body, BodyType="<STR_LIT>"))<EOL>)<EOL><DEDENT>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.Body(event.text_body, BodyType="<STR_LIT>"))<EOL>)<EOL><DEDENT>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.Subject(event.subject))<EOL>)<EOL><DEDENT>if u'<STR_LIT:start>' in updated_attributes:<EOL><INDENT>start = convert_datetime_to_utc(event.start)<EOL>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.Start(start.strftime(EXCHANGE_DATETIME_FORMAT)))<EOL>)<EOL><DEDENT>if u'<STR_LIT:end>' in updated_attributes:<EOL><INDENT>end = convert_datetime_to_utc(event.end)<EOL>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.End(end.strftime(EXCHANGE_DATETIME_FORMAT)))<EOL>)<EOL><DEDENT>if u'<STR_LIT:location>' in updated_attributes:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.Location(event.location))<EOL>)<EOL><DEDENT>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>if event.required_attendees:<EOL><INDENT>required = resource_node(element=T.RequiredAttendees(), resources=event.required_attendees)<EOL>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=required)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>update_node.append(delete_field(field_uri="<STR_LIT>"))<EOL><DEDENT>if event.optional_attendees:<EOL><INDENT>optional = resource_node(element=T.OptionalAttendees(), resources=event.optional_attendees)<EOL>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=optional)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>update_node.append(delete_field(field_uri="<STR_LIT>"))<EOL><DEDENT><DEDENT>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>if event.resources:<EOL><INDENT>resources = resource_node(element=T.Resources(), resources=event.resources)<EOL>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=resources)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>update_node.append(delete_field(field_uri="<STR_LIT>"))<EOL><DEDENT><DEDENT>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>if event.reminder_minutes_before_start:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.ReminderIsSet('<STR_LIT:true>'))<EOL>)<EOL>update_node.append(<EOL>update_property_node(<EOL>field_uri="<STR_LIT>",<EOL>node_to_insert=T.ReminderMinutesBeforeStart(str(event.reminder_minutes_before_start))<EOL>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.ReminderIsSet('<STR_LIT:false>'))<EOL>)<EOL><DEDENT><DEDENT>if u'<STR_LIT>' in updated_attributes:<EOL><INDENT>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=T.IsAllDayEvent(str(event.is_all_day).lower()))<EOL>)<EOL><DEDENT>for attr in event.RECURRENCE_ATTRIBUTES:<EOL><INDENT>if attr in updated_attributes:<EOL><INDENT>recurrence_node = T.Recurrence()<EOL>if event.recurrence == '<STR_LIT>':<EOL><INDENT>recurrence_node.append(<EOL>T.DailyRecurrence(<EOL>T.Interval(str(event.recurrence_interval)),<EOL>)<EOL>)<EOL><DEDENT>elif event.recurrence == '<STR_LIT>':<EOL><INDENT>recurrence_node.append(<EOL>T.WeeklyRecurrence(<EOL>T.Interval(str(event.recurrence_interval)),<EOL>T.DaysOfWeek(event.recurrence_days),<EOL>)<EOL>)<EOL><DEDENT>elif event.recurrence == '<STR_LIT>':<EOL><INDENT>recurrence_node.append(<EOL>T.AbsoluteMonthlyRecurrence(<EOL>T.Interval(str(event.recurrence_interval)),<EOL>T.DayOfMonth(str(event.start.day)),<EOL>)<EOL>)<EOL><DEDENT>elif event.recurrence == '<STR_LIT>':<EOL><INDENT>recurrence_node.append(<EOL>T.AbsoluteYearlyRecurrence(<EOL>T.DayOfMonth(str(event.start.day)),<EOL>T.Month(event.start.strftime("<STR_LIT>")),<EOL>)<EOL>)<EOL><DEDENT>recurrence_node.append(<EOL>T.EndDateRecurrence(<EOL>T.StartDate(event.start.strftime(EXCHANGE_DATE_FORMAT)),<EOL>T.EndDate(event.recurrence_end_date.strftime(EXCHANGE_DATE_FORMAT)),<EOL>)<EOL>)<EOL>update_node.append(<EOL>update_property_node(field_uri="<STR_LIT>", node_to_insert=recurrence_node)<EOL>)<EOL><DEDENT><DEDENT>return root<EOL>
Saves updates to an event in the store. Only request changes for attributes that have actually changed.