🔍 Code Extractor

class FollowupFlag

Maturity: 47

A data class representing a follow-up flag that can be attached to items (like emails or tasks) to mark them for later action, with configurable start, due, and completion dates.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/messages/followup_flag.py
Lines:
5 - 26
Complexity:
simple

Purpose

This class encapsulates follow-up flag metadata for Microsoft Outlook items. It allows users to set reminders and track the status of items that require follow-up action. The class inherits from ClientValue, making it suitable for serialization and transmission to Microsoft Graph API endpoints. It manages temporal aspects of follow-up tasks including when to start, when it's due, when it was completed, and the current status of the flag.

Source Code

class FollowupFlag(ClientValue):
    """Allows setting a flag in an item for the user to follow up on later."""

    def __init__(
        self,
        completed_datetime=DateTimeTimeZone(),
        due_datetime=DateTimeTimeZone(),
        flag_status=None,
        start_datetime=DateTimeTimeZone(),
    ):
        """
        :param DateTimeTimeZone completed_datetime: The date and time that the follow-up was finished.
        :param DateTimeTimeZone due_datetime: The date and time that the follow up is to be finished.
             Note: To set the due date, you must also specify the startDateTime; otherwise, you will
             get a 400 Bad Request response.
        :param str flag_status: The status for follow-up for an item.
        :param DateTimeTimeZone start_datetime: The date and time that the follow-up is to begin.
        """
        self.completedDateTime = completed_datetime
        self.dueDateTime = due_datetime
        self.flagStatus = flag_status
        self.startDateTime = start_datetime

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

completed_datetime: A DateTimeTimeZone object representing when the follow-up task was finished. Defaults to an empty DateTimeTimeZone instance. This should be set when the follow-up action has been completed.

due_datetime: A DateTimeTimeZone object indicating the deadline for completing the follow-up. Defaults to an empty DateTimeTimeZone instance. Important: Setting this requires also setting start_datetime, otherwise the API will return a 400 Bad Request error.

flag_status: A string indicating the current status of the follow-up flag. Expected values typically include 'notFlagged', 'complete', or 'flagged'. Defaults to None if not specified.

start_datetime: A DateTimeTimeZone object representing when the follow-up period begins. Defaults to an empty DateTimeTimeZone instance. This must be set if you want to specify a due_datetime.

Return Value

Instantiation returns a FollowupFlag object with four instance attributes (completedDateTime, dueDateTime, flagStatus, startDateTime) that can be serialized and sent to Microsoft Graph API. The object itself doesn't have methods that return values, but serves as a data container for follow-up flag information.

Class Interface

Methods

__init__(completed_datetime=DateTimeTimeZone(), due_datetime=DateTimeTimeZone(), flag_status=None, start_datetime=DateTimeTimeZone())

Purpose: Initializes a new FollowupFlag instance with optional datetime parameters and status

Parameters:

  • completed_datetime: DateTimeTimeZone object for when the follow-up was finished
  • due_datetime: DateTimeTimeZone object for the follow-up deadline (requires start_datetime to be set)
  • flag_status: String indicating the flag status ('notFlagged', 'complete', 'flagged')
  • start_datetime: DateTimeTimeZone object for when the follow-up period begins

Returns: A new FollowupFlag instance

Attributes

Name Type Description Scope
completedDateTime DateTimeTimeZone Stores the date and time when the follow-up task was completed instance
dueDateTime DateTimeTimeZone Stores the deadline date and time for the follow-up task instance
flagStatus str or None Stores the current status of the follow-up flag (e.g., 'flagged', 'complete', 'notFlagged') instance
startDateTime DateTimeTimeZone Stores the date and time when the follow-up period begins instance

Dependencies

  • office365.outlook.calendar.dateTimeTimeZone
  • office365.runtime.client_value

Required Imports

from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
from office365.outlook.mail.followup_flag import FollowupFlag

Usage Example

from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
from office365.outlook.mail.followup_flag import FollowupFlag

# Create a simple follow-up flag with just status
flag = FollowupFlag(flag_status='flagged')

# Create a complete follow-up flag with dates
start_date = DateTimeTimeZone()
start_date.dateTime = '2024-01-15T09:00:00'
start_date.timeZone = 'Pacific Standard Time'

due_date = DateTimeTimeZone()
due_date.dateTime = '2024-01-20T17:00:00'
due_date.timeZone = 'Pacific Standard Time'

flag_with_dates = FollowupFlag(
    start_datetime=start_date,
    due_datetime=due_date,
    flag_status='flagged'
)

# Mark as completed
completed_date = DateTimeTimeZone()
completed_date.dateTime = '2024-01-18T14:30:00'
completed_date.timeZone = 'Pacific Standard Time'

flag_with_dates.completedDateTime = completed_date
flag_with_dates.flagStatus = 'complete'

Best Practices

  • Always set start_datetime when setting due_datetime to avoid 400 Bad Request errors from the API
  • Use proper DateTimeTimeZone objects with both dateTime and timeZone properties set for accurate scheduling across time zones
  • Set flag_status to 'complete' and populate completed_datetime when marking a follow-up as finished
  • Valid flag_status values are typically 'notFlagged', 'complete', or 'flagged' - verify with Microsoft Graph API documentation
  • This class is a data container (ClientValue) meant for serialization, not for business logic - it should be used as part of larger Outlook item operations
  • The class follows camelCase naming convention for attributes (completedDateTime, dueDateTime, etc.) to match Microsoft Graph API property names
  • Create new instances for each follow-up flag rather than reusing instances to avoid state confusion

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class FollowedItem 61.6% similar

    A data class representing an item that is followed by a user in a SharePoint/Office365 context, specifically designed for server-to-server operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/userprofiles/followed_item.py
  • class FollowResult 59.6% similar

    A data class that encapsulates the result of a follow operation on a SharePoint item, containing the followed item and the result status.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/userprofiles/follow_result.py
  • class OutlookItem 55.2% similar

    OutlookItem is a base class representing a Microsoft Outlook item entity with common properties like change tracking, categories, and timestamps.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/item.py
  • class AttendeeAvailability 53.2% similar

    A data class representing the availability status of an attendee for a calendar event in Microsoft Outlook.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/calendar/attendees/availability.py
  • class AttachmentItem 52.9% similar

    A data class representing metadata attributes of an attachment item, including its type, name, and size.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/attachments/attachment_item.py
← Back to Browse