🔍 Code Extractor

class ContactFolder

Maturity: 32

A folder that contains contacts.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/contacts/folder.py
Lines:
10 - 72
Complexity:
moderate

Purpose

A folder that contains contacts.

Source Code

class ContactFolder(Entity):
    """A folder that contains contacts."""

    @property
    def contacts(self):
        """The contacts in the folder. Navigation property. Read-only. Nullable."""
        from office365.outlook.contacts.contact import Contact

        return self.properties.get(
            "contacts",
            EntityCollection(
                self.context, Contact, ResourcePath("contacts", self.resource_path)
            ),
        )

    @property
    def child_folders(self):
        # type: () -> EntityCollection["ContactFolder"]
        """The collection of child folders in the folder. Navigation property. Read-only. Nullable."""
        return self.properties.get(
            "childFolders",
            EntityCollection(
                self.context,
                ContactFolder,
                ResourcePath("childFolders", self.resource_path),
            ),
        )

    @property
    def multi_value_extended_properties(self):
        # type: () -> EntityCollection[MultiValueLegacyExtendedProperty]
        """The collection of multi-value extended properties defined for the Contact folder."""
        return self.properties.get(
            "multiValueExtendedProperties",
            EntityCollection(
                self.context,
                MultiValueLegacyExtendedProperty,
                ResourcePath("multiValueExtendedProperties", self.resource_path),
            ),
        )

    @property
    def single_value_extended_properties(self):
        # type: () -> EntityCollection[SingleValueLegacyExtendedProperty]
        """The collection of single-value extended properties defined for the Contact folder."""
        return self.properties.get(
            "singleValueExtendedProperties",
            EntityCollection(
                self.context,
                SingleValueLegacyExtendedProperty,
                ResourcePath("singleValueExtendedProperties", self.resource_path),
            ),
        )

    def get_property(self, name, default_value=None):
        if default_value is None:
            property_mapping = {
                "childFolders": self.child_folders,
                "multiValueExtendedProperties": self.multi_value_extended_properties,
                "singleValueExtendedProperties": self.single_value_extended_properties,
            }
            default_value = property_mapping.get(name, None)
        return super(ContactFolder, self).get_property(name, default_value)

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Parameter of type Entity

Return Value

Returns unspecified type

Class Interface

Methods

contacts(self) property

Purpose: The contacts in the folder. Navigation property. Read-only. Nullable.

Returns: None

child_folders(self) property

Purpose: The collection of child folders in the folder. Navigation property. Read-only. Nullable.

Returns: None

multi_value_extended_properties(self) property

Purpose: The collection of multi-value extended properties defined for the Contact folder.

Returns: None

single_value_extended_properties(self) property

Purpose: The collection of single-value extended properties defined for the Contact folder.

Returns: None

get_property(self, name, default_value)

Purpose: Retrieves property

Parameters:

  • name: Parameter
  • default_value: Parameter

Returns: None

Required Imports

from office365.directory.extensions.extended_property import MultiValueLegacyExtendedProperty
from office365.directory.extensions.extended_property import SingleValueLegacyExtendedProperty
from office365.entity import Entity
from office365.entity_collection import EntityCollection
from office365.runtime.paths.resource_path import ResourcePath

Usage Example

# Example usage:
# result = ContactFolder(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class FolderCollection 63.6% similar

    Represents a collection of Folder resources.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/folders/collection.py
  • class Folder 62.1% similar

    Represents a folder in a SharePoint Web site.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/folders/folder.py
  • class Contact 60.9% similar

    User's contact.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/contacts/contact.py
  • class MailFolder 57.4% similar

    Represents a mail folder in a user's mailbox (e.g., Inbox, Drafts) that can contain messages, Outlook items, and child folders. Provides methods for folder operations like copying, emptying, and marking messages as read/unread.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/folders/folder.py
  • class ContactCollection 56.9% similar

    A collection class for managing Microsoft Outlook contacts, providing methods to add and manage Contact objects within a contact folder or root Contacts folder.

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