🔍 Code Extractor

class ExternalConnection

Maturity: 45

A class representing a logical container for adding and managing content from external sources into Microsoft Graph's search index.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/external/connection.py
Lines:
6 - 27
Complexity:
moderate

Purpose

ExternalConnection serves as a wrapper entity for managing external data sources in Microsoft Graph. It provides access to configuration settings and search settings that control how external content is indexed, managed, and displayed in Microsoft Graph search results. This class inherits from Entity and is part of the Microsoft Graph external connectors framework, allowing applications to integrate third-party data sources into Microsoft 365 search experiences.

Source Code

class ExternalConnection(Entity):
    """A logical container to add content from an external source into Microsoft Graph."""

    @property
    def configuration(self):
        """
        Specifies additional application IDs that are allowed to manage the connection and to index
        content in the connection. Optional.
        """
        return self.properties.get("configuration", Configuration())

    @property
    def search_settings(self):
        """
        The settings configuring the search experience for content in this connection,
        such as the display templates for search results.
        """
        return self.properties.get("searchSettings", SearchSettings())

    @property
    def entity_type_name(self):
        return "microsoft.graph.externalConnectors.externalConnection"

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

__init__: Inherits constructor from Entity base class. The exact parameters depend on the Entity parent class implementation, but typically includes properties dictionary or individual property values that define the connection's state and metadata.

Return Value

Instantiation returns an ExternalConnection object that represents a configured external data source connection in Microsoft Graph. The object provides access to configuration and search settings through property accessors.

Class Interface

Methods

@property configuration(self) -> Configuration property

Purpose: Returns the configuration object that specifies additional application IDs allowed to manage the connection and index content

Returns: Configuration object containing application IDs and management settings. Returns a default Configuration() instance if not set in properties.

@property search_settings(self) -> SearchSettings property

Purpose: Returns the search settings that configure the search experience for content in this connection, including display templates for search results

Returns: SearchSettings object containing search configuration and display templates. Returns a default SearchSettings() instance if not set in properties.

@property entity_type_name(self) -> str property

Purpose: Returns the Microsoft Graph entity type identifier for this class

Returns: String constant 'microsoft.graph.externalConnectors.externalConnection' used for type identification in Graph API operations

Attributes

Name Type Description Scope
properties dict Inherited from Entity base class. Dictionary storing the connection's properties including configuration and searchSettings data instance

Dependencies

  • office365.entity
  • office365.search.external.configuration
  • office365.search.external.search_settings

Required Imports

from office365.entity import Entity
from office365.search.external.configuration import Configuration
from office365.search.external.search_settings import SearchSettings

Usage Example

from office365.search.external.external_connection import ExternalConnection
from office365.entity import Entity

# Instantiate an external connection (typically retrieved from Graph API)
connection = ExternalConnection()

# Access configuration settings
config = connection.configuration
print(f"Configuration: {config}")

# Access search settings for the connection
search_settings = connection.search_settings
print(f"Search settings: {search_settings}")

# Get the entity type name
entity_type = connection.entity_type_name
print(f"Entity type: {entity_type}")

Best Practices

  • This class is typically instantiated through Microsoft Graph API responses rather than direct construction
  • Access configuration and search_settings properties to customize how external content is indexed and displayed
  • The properties dictionary (inherited from Entity) stores the actual data; property accessors provide typed access with defaults
  • Ensure proper authentication and permissions are configured before attempting to manage external connections
  • The entity_type_name property is used internally by the Microsoft Graph SDK for type identification
  • Configuration and SearchSettings objects are returned with defaults if not present in the properties dictionary

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class External 89.5% similar

    A logical container class for managing external data sources in Microsoft 365, providing access to external connections through a collection interface.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/external/external.py
  • class Configuration 68.2% similar

    A configuration class that specifies additional application IDs allowed to manage and index content in an externalConnection within the Office365 environment.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/external/configuration.py
  • class ExternalUser 60.5% similar

    A class representing an external user in SharePoint Online tenant management, inheriting from Entity base class.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/management/externalusers/external_user.py
  • class ExternalUserCollection 59.7% similar

    A collection class for managing external users in SharePoint, providing methods to retrieve and interact with external user entities.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/management/externalusers/collection.py
  • class SearchEntity 59.3% similar

    A wrapper class for the Microsoft Graph Search API endpoint that provides methods to query various Microsoft 365 resources including messages, events, drive items, and other entity types.

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