🔍 Code Extractor

class ExternalUser

Maturity: 24

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

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/management/externalusers/external_user.py
Lines:
4 - 7
Complexity:
simple

Purpose

This class models external users (users outside the organization) in SharePoint Online tenant management. It provides a specialized entity type for working with external user objects through the SharePoint REST API. The class primarily serves as a data model with specific entity type identification for SharePoint's tenant management operations involving external users.

Source Code

class ExternalUser(Entity):
    @property
    def entity_type_name(self):
        return "Microsoft.Online.SharePoint.TenantManagement.ExternalUser"

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 would include context and resource path parameters for SharePoint API operations.

Return Value

Instantiation returns an ExternalUser object that represents a SharePoint external user entity. The entity_type_name property returns the string 'Microsoft.Online.SharePoint.TenantManagement.ExternalUser' which identifies this entity type in SharePoint's type system.

Class Interface

Methods

@property entity_type_name(self) -> str property

Purpose: Returns the fully qualified entity type name used by SharePoint's REST API to identify this entity type

Returns: String value 'Microsoft.Online.SharePoint.TenantManagement.ExternalUser' representing the SharePoint entity type

Attributes

Name Type Description Scope
entity_type_name str Read-only property that returns the SharePoint entity type identifier for external users instance

Dependencies

  • office365

Required Imports

from office365.sharepoint.entity import Entity
from office365.sharepoint.tenant.administration.external_user import ExternalUser

Usage Example

from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.tenant.administration.external_user import ExternalUser
from office365.runtime.auth.user_credential import UserCredential

# Setup authentication
site_url = 'https://yourtenant.sharepoint.com'
username = 'admin@yourtenant.onmicrosoft.com'
password = 'your_password'

# Create context
ctx = ClientContext(site_url).with_credentials(UserCredential(username, password))

# Work with external user (typically retrieved from tenant admin operations)
# External users are usually accessed through tenant administration APIs
external_user = ExternalUser(ctx)
print(external_user.entity_type_name)  # Outputs: Microsoft.Online.SharePoint.TenantManagement.ExternalUser

Best Practices

  • This class is typically not instantiated directly but rather retrieved through SharePoint tenant administration API calls
  • Ensure proper authentication and tenant admin permissions before attempting to work with external user objects
  • The entity_type_name property is used internally by the Office365 library for proper serialization and API communication
  • External users represent users outside your organization who have been granted access to SharePoint resources
  • This class inherits all functionality from the Entity base class, so refer to Entity documentation for available methods and properties
  • Use this class in conjunction with tenant administration operations for managing external sharing and collaboration

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class ExternalUserCollection 84.3% 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 RemoveExternalUsersResults 78.2% similar

    A SharePoint entity class representing the results of removing external users from a SharePoint tenant.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/management/externalusers/results/remove.py
  • class GetExternalUsersResults 78.2% similar

    A class representing the results of a query for external users in SharePoint Online tenant management, providing access to user count, collection position, and the collection of external users.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/management/externalusers/results/get.py
  • class UserExperienceState 67.2% similar

    UserExperienceState is a SharePoint entity class that represents the user experience state within a SharePoint environment, inheriting from the Entity base class.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/apps/user_experience_state.py
  • class External 65.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
← Back to Browse