class AssignedLabel
Represents a sensitivity label assigned to a Microsoft 365 group, enabling administrators to enforce specific group settings through classifications like Confidential or General.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/groups/assigned_label.py
4 - 11
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
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class Label 63.7% similar
-
class OrgLabelsContext 59.8% similar
-
class InformationProtection 59.5% similar
-
class PendingReviewItemsStatistics 57.1% similar
-
class PermissionCollection 55.1% similar