🔍 Code Extractor

class GroupCreationContext

Maturity: 24

A client value class representing the context for creating a SharePoint group, inheriting from ClientValue base class.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/groups/creation_context.py
Lines:
4 - 7
Complexity:
simple

Purpose

GroupCreationContext serves as a data transfer object (DTO) for SharePoint group creation operations. It encapsulates the necessary context information when creating groups in SharePoint Online/Office 365 environments. The class provides the entity type name identifier used by the SharePoint REST API to properly serialize and deserialize group creation requests.

Source Code

class GroupCreationContext(ClientValue):
    @property
    def entity_type_name(self):
        return "Microsoft.SharePoint.Portal.GroupCreationContext"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

bases: Inherits from ClientValue, which is the base class for client-side value objects in the Office 365 Python SDK. This provides serialization/deserialization capabilities for SharePoint API communication.

Return Value

Instantiation returns a GroupCreationContext object that can be used to represent group creation context in SharePoint API calls. The entity_type_name property returns the string 'Microsoft.SharePoint.Portal.GroupCreationContext' which identifies this object type to the SharePoint server.

Class Interface

Methods

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type name identifier for this context object, used for proper serialization in SharePoint REST API calls

Returns: String 'Microsoft.SharePoint.Portal.GroupCreationContext' which identifies this object type to SharePoint server

Attributes

Name Type Description Scope
entity_type_name str Read-only property that returns the SharePoint entity type identifier 'Microsoft.SharePoint.Portal.GroupCreationContext' instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.sharepoint.portal.group_creation_context import GroupCreationContext

Usage Example

from office365.sharepoint.portal.group_creation_context import GroupCreationContext
from office365.sharepoint.client_context import ClientContext

# Authenticate to SharePoint
ctx = ClientContext(site_url).with_credentials(credentials)

# Create a group creation context
group_context = GroupCreationContext()

# The context can be used with SharePoint group creation APIs
# Typically populated with additional properties before use
# group_context.set_property('DisplayName', 'My New Group')
# group_context.set_property('Alias', 'mynewgroup')

# Use with SharePoint group creation methods
# result = ctx.web.create_group(group_context)
# ctx.execute_query()

Best Practices

  • This class is typically instantiated and then populated with properties using inherited methods from ClientValue before being passed to SharePoint group creation APIs
  • The entity_type_name property should not be modified as it identifies the object type to SharePoint's REST API
  • Always use this class within the context of an authenticated ClientContext to ensure proper API communication
  • This is a data container class - it does not perform operations itself but is used as a parameter for group creation operations
  • Inherit from this class if you need to extend group creation context with custom properties
  • The class follows the Office 365 SDK pattern where ClientValue objects are serialized to JSON for API requests

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class GroupCreationInformation_v1 74.9% similar

    A data class that encapsulates information required to create a SharePoint group, including display name, alias, visibility settings, and optional parameters.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/groups/creation_information.py
  • class SharePointHomePageContext 74.4% similar

    A client value class representing the context for a SharePoint home page, used for serialization and communication with SharePoint Portal Home services.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/home/page_context.py
  • class GroupCreationInformation 73.4% similar

    A data transfer object (DTO) class that encapsulates information required to create a cross-site SharePoint group.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/principal/groups/creation_information.py
  • class ClientContext 68.9% similar

    SharePoint client context (SharePoint v1 API)

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/client_context.py
  • class SiteCreationSource 67.0% similar

    A client value class representing a source for SharePoint site creation, containing a collection of site creation data objects.

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