🔍 Code Extractor

class AssignedLabel

Maturity: 50

Represents a sensitivity label assigned to a Microsoft 365 group, enabling administrators to enforce specific group settings through classifications like Confidential or General.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/groups/assigned_label.py
Lines:
4 - 11
Complexity:
simple

Purpose

This class serves as a data model for sensitivity labels in Microsoft 365 groups, part of Microsoft Purview Information Protection capabilities. It inherits from ClientValue to provide serialization and deserialization capabilities for API communication with Microsoft 365 services. The class is used to represent and manage sensitivity label assignments that control group settings and access policies in the Security and Compliance Center.

Source Code

class AssignedLabel(ClientValue):
    """
    Represents a sensitivity label assigned to a Microsoft 365 group. Sensitivity labels allow administrators
    to enforce specific group settings on a group by assigning a classification to the group (such as Confidential,
    Highly Confidential or General). Sensitivity labels are published by administrators in Microsoft 365 Security and
    Compliance Center as part of Microsoft Purview Information Protection capabilities. For more information about
    sensitivity labels, see Sensitivity labels overview.
    """

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

bases: Inherits from ClientValue, which provides base functionality for client-side value objects that can be serialized/deserialized for API communication with Microsoft 365 services

Return Value

Instantiation returns an AssignedLabel object that represents a sensitivity label. The object inherits serialization capabilities from ClientValue, allowing it to be converted to/from JSON for API requests and responses. Specific return values depend on inherited methods from ClientValue.

Class Interface

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.entity_collections.assigned_label import AssignedLabel

Usage Example

from office365.runtime.client_value import ClientValue
from office365.entity_collections.assigned_label import AssignedLabel

# Typically instantiated through API responses or created for API requests
label = AssignedLabel()

# The class inherits from ClientValue, so it can be serialized
# Usually used in context of Microsoft 365 group operations:
# group.assigned_labels would return a collection of AssignedLabel objects

# Example in context of retrieving group labels:
# from office365.graph_client import GraphClient
# client = GraphClient(credentials)
# group = client.groups.get_by_id('group-id')
# labels = group.assigned_labels
# for label in labels:
#     # Process each AssignedLabel instance
#     pass

Best Practices

  • This class is typically instantiated automatically by the Office365 SDK when retrieving group information from Microsoft 365 APIs
  • Do not manually instantiate unless creating new label assignments for API requests
  • The class inherits serialization behavior from ClientValue, so modifications to instances should respect the parent class's data structure
  • Sensitivity labels must be published in Microsoft 365 Security and Compliance Center before they can be assigned
  • Ensure proper authentication and permissions are configured before attempting to read or modify sensitivity labels
  • This is a data transfer object (DTO) - it primarily holds data rather than implementing complex business logic
  • When working with sensitivity labels, always verify that Microsoft Purview Information Protection is enabled in your tenant

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class Label 63.7% similar

    A class representing a localized label with name, default status, and language tag information, inheriting from ClientValue.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/taxonomy/terms/label.py
  • class OrgLabelsContext 59.8% similar

    OrgLabelsContext is a client value class representing organizational labels context in SharePoint Portal, inheriting from ClientValue base class.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/orglabels/context.py
  • class InformationProtection 59.5% similar

    A class that provides methods to interact with Microsoft Purview Information Protection services, specifically for creating threat assessment requests for email messages.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/protection/information.py
  • class PendingReviewItemsStatistics 57.1% similar

    A data class representing statistics for pending review items in SharePoint's compliance policy system, tracking label information for items awaiting review.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/compliance/pending_review_items_statistics.py
  • class PermissionCollection 55.1% similar

    A SharePoint client value class representing a collection of permissions for a securable object, containing LinkInfo and PrincipalInfo objects for users/groups with access.

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