🔍 Code Extractor

class PersonalSiteCreationPriority

Maturity: 41

An enumeration class that defines priority levels for creating personal sites in a SharePoint or similar system.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/userprofiles/personal_site_creation_priority.py
Lines:
1 - 11
Complexity:
simple

Purpose

This class serves as a simple enumeration to represent three priority levels (Low, Medium, High) for personal site creation operations. It provides named constants with integer values (0, 1, 2) that can be used to specify the urgency or importance when creating personal sites programmatically. This is typically used in SharePoint administration or user provisioning scenarios where personal sites need to be created with different priority levels.

Source Code

class PersonalSiteCreationPriority:
    """The PersonalSiteCreationPriority enumeration specifies the priority for creating personal sites"""

    Low = 0
    """The priority for creating personal sites is low."""

    Medium = 1
    """The priority for creating personal sites is medium."""

    High = 2
    """The priority for creating personal sites is high."""

Parameters

Name Type Default Kind
bases - -

Parameter Details

bases: This parameter is automatically provided by Python when defining a class and represents the base classes from which this class inherits. In this case, it inherits from the default 'object' base class since no explicit base class is specified.

Return Value

Instantiating this class returns a PersonalSiteCreationPriority object, though this class is designed to be used as a static enumeration where you access the class attributes directly (e.g., PersonalSiteCreationPriority.Low) rather than creating instances. The class attributes Low, Medium, and High return integer values 0, 1, and 2 respectively.

Class Interface

Attributes

Name Type Description Scope
Low int Represents low priority for creating personal sites with a value of 0 class
Medium int Represents medium priority for creating personal sites with a value of 1 class
High int Represents high priority for creating personal sites with a value of 2 class

Usage Example

# Access priority levels directly from the class
priority_low = PersonalSiteCreationPriority.Low  # Returns 0
priority_medium = PersonalSiteCreationPriority.Medium  # Returns 1
priority_high = PersonalSiteCreationPriority.High  # Returns 2

# Use in a function that creates personal sites
def create_personal_site(user_id, priority):
    if priority == PersonalSiteCreationPriority.High:
        print(f"Creating site for {user_id} with high priority")
    elif priority == PersonalSiteCreationPriority.Medium:
        print(f"Creating site for {user_id} with medium priority")
    else:
        print(f"Creating site for {user_id} with low priority")

# Call the function with different priorities
create_personal_site("user123", PersonalSiteCreationPriority.High)
create_personal_site("user456", PersonalSiteCreationPriority.Low)

Best Practices

  • Use the class attributes directly without instantiating the class (e.g., PersonalSiteCreationPriority.High)
  • Do not modify the class attribute values as they are intended to be constants
  • Consider using Python's built-in enum.Enum or enum.IntEnum for more robust enumeration behavior in production code
  • Use these constants in comparison operations rather than hardcoding integer values for better code readability
  • This class follows a simple constant pattern but lacks the type safety and features of Python's enum module

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SiteStatus 62.8% similar

    An enumeration-style class that defines status codes for modern SharePoint sites, representing different states during site lifecycle.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/sites/status.py
  • class PersonalizationScope 59.8% similar

    An enumeration class that defines personalization scope constants for the LimitedWebPartManager object in SharePoint Web Parts.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/webparts/personalization_scope.py
  • class DenyAddAndCustomizePagesStatus 58.9% similar

    An enumeration class that defines constants representing the status of the DenyAddAndCustomizePages feature on a SharePoint site collection.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/deny_add_and_customize_pages_status.py
  • class PersonalWeb 58.7% similar

    PersonalWeb is a SharePoint client class that provides methods for managing a user's personal web site, specifically operations on the user's default document library.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/personal_web.py
  • class SiteType 58.1% similar

    A simple enumeration-like class that defines constants for SharePoint site types.

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