class GroupCreationInformation
A data transfer object (DTO) class that encapsulates information required to create a cross-site SharePoint group.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/principal/groups/creation_information.py
4 - 17
simple
Purpose
This class serves as a container for group creation parameters when working with SharePoint's group management API. It inherits from ClientValue, which is part of the Office365 REST API Python client library, and provides a structured way to pass group creation data to SharePoint services. The class is designed to be serialized and sent to SharePoint endpoints for creating new groups across sites.
Source Code
class GroupCreationInformation(ClientValue):
"""An object used to facilitate creation of a cross-site group."""
def __init__(self, title=None, description=None):
"""
:param str title:
:param str description:
"""
self.Title = title
self.Description = description
@property
def entity_type_name(self):
return "SP.Group"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
title: The display name/title of the SharePoint group to be created. This is an optional string parameter that identifies the group. If not provided, defaults to None.
description: A textual description of the SharePoint group's purpose or membership criteria. This is an optional string parameter that provides context about the group. If not provided, defaults to None.
Return Value
Instantiation returns a GroupCreationInformation object with Title and Description attributes set to the provided values (or None if not provided). The entity_type_name property returns the string 'SP.Group', which identifies the SharePoint entity type for serialization purposes.
Class Interface
Methods
__init__(title=None, description=None)
Purpose: Initializes a new GroupCreationInformation instance with optional title and description
Parameters:
title: Optional string representing the group's display namedescription: Optional string describing the group's purpose
Returns: None (constructor)
entity_type_name -> str
property
Purpose: Returns the SharePoint entity type identifier for this object, used for serialization and API communication
Returns: String 'SP.Group' representing the SharePoint entity type
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
Title |
str or None | The display name/title of the SharePoint group to be created | instance |
Description |
str or None | A textual description of the SharePoint group's purpose | instance |
Dependencies
office365-rest-python-client
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
from office365.sharepoint.groups.group_creation_information import GroupCreationInformation
# Create a new group information object
group_info = GroupCreationInformation(
title="Marketing Team",
description="Group for marketing department members"
)
# Access the attributes
print(group_info.Title) # Output: Marketing Team
print(group_info.Description) # Output: Group for marketing department members
print(group_info.entity_type_name) # Output: SP.Group
# Typically used with SharePoint context to create a group
# ctx.web.site_groups.add(group_info)
# ctx.execute_query()
Best Practices
- Always provide a meaningful title when creating a group, as it serves as the primary identifier for users
- Include a clear description to help users understand the group's purpose and membership criteria
- This class is designed to be used with SharePoint context objects and should not be instantiated in isolation without a proper SharePoint connection
- The class is immutable after creation in typical usage - set all required properties during instantiation
- This object is typically passed to SharePoint API methods like site_groups.add() rather than used standalone
- The entity_type_name property is used internally by the Office365 library for serialization and should not be modified
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class GroupCreationInformation_v1 86.8% similar
-
class ViewCreationInformation 77.9% similar
-
class WebCreationInformation 77.4% similar
-
class SiteUserGroupInfo 75.8% similar
-
class ContentTypeCreationInformation 75.5% similar