Integrations/MicrosoftGraphCalendar/MicrosoftGraphCalendar.py
def parse_events(raw_events: Union[Dict, List[Dict]]) -> Tuple[List[Dict], List[Dict]]:
    """
    Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
    :param raw_events: raw events data
    """
    # Fields to filter, dropping to not bloat the incident context.
    fields_to_drop = ['@odata.etag', 'color']
    if not isinstance(raw_events, list):
        raw_events = [raw_events]

    readable_events, context_output = [], []
    for event in raw_events:
        event_readable: Dict = camel_case_to_readable(event, fields_to_drop)  # type: ignore
        if '@removed' in event:
            event_readable['Status'] = 'deleted'
        event_context = {field.replace(' ', ''): value for field, value in event_readable.items()}

        event_readable = {
            'Subject': event_readable.get('Subject'),
            'ID': event_readable.get('ID'),
            'Organizer': demisto.get(event_readable, 'Organizer.emailAddress.name'),
            'Attendees': [att.get('emailAddress', {}).get('name') for att in event_readable.get('Attendees', [])],
            'Start': event_readable.get('Start', {}).get('dateTime'),
            'End': event_readable.get('End', {}).get('dateTime')
        }
        readable_events.append(event_readable)
        context_output.append(event_context)

    return readable_events, context_output

    Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
    :param raw_events: raw events data
    
Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
def parse_events(raw_events: Union[Dict, List[Dict]]) -> Tuple[List[Dict], List[Dict]]:
    fields_to_drop = ['@odata.etag', 'color']
    if not isinstance(raw_events, list):
        raw_events = [raw_events]
    readable_events, context_output = [], []
    for event in raw_events:
        event_readable: Dict = camel_case_to_readable(event, fields_to_drop)  
        if '@removed' in event:
            event_readable['Status'] = 'deleted'
        event_context = {field.replace(' ', ''): value for field, value in event_readable.items()}
        event_readable = {
            'Subject': event_readable.get('Subject'),
            'ID': event_readable.get('ID'),
            'Organizer': demisto.get(event_readable, 'Organizer.emailAddress.name'),
            'Attendees': [att.get('emailAddress', {}).get('name') for att in event_readable.get('Attendees', [])],
            'Start': event_readable.get('Start', {}).get('dateTime'),
            'End': event_readable.get('End', {}).get('dateTime')
        }
        readable_events.append(event_readable)
        context_output.append(event_context)
    return readable_events, context_output
def parse_events ( raw_events : Union [ Dict , List [ Dict ] ] ) -> Tuple [ List [ Dict ] , List [ Dict ] ] : fields_to_drop = [ '@odata.etag' , 'color' ] if not isinstance ( raw_events , list ) : raw_events = [ raw_events ] readable_events , context_output = [ ] , [ ] for event in raw_events : event_readable : Dict = camel_case_to_readable ( event , fields_to_drop ) if '@removed' in event : event_readable [ 'Status' ] = 'deleted' event_context = { field . replace ( ' ' , '' ) : value for field , value in event_readable . items ( ) } event_readable = { 'Subject' : event_readable . get ( 'Subject' ) , 'ID' : event_readable . get ( 'ID' ) , 'Organizer' : demisto . get ( event_readable , 'Organizer.emailAddress.name' ) , 'Attendees' : [ att . get ( 'emailAddress' , { } ) . get ( 'name' ) for att in event_readable . get ( 'Attendees' , [ ] ) ] , 'Start' : event_readable . get ( 'Start' , { } ) . get ( 'dateTime' ) , 'End' : event_readable . get ( 'End' , { } ) . get ( 'dateTime' ) } readable_events . append ( event_readable ) context_output . append ( event_context ) return readable_events , context_output
Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
"""
    Parse Calendar Events json data coming from Microsoft Graph into Demisto readable format
    :param raw_events: raw events data
    """ # Fields to filter, dropping to not bloat the incident context. # type: ignore
raw_events
Union[Dict, List[Dict]]
raw events data
raw events data