🔍 Code Extractor

class PeoplePickerQuerySettings

Maturity: 47

A data class representing additional settings for SharePoint principal queries, specifically for people picker operations.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/query_settings.py
Lines:
4 - 18
Complexity:
simple

Purpose

This class encapsulates configuration settings used when querying for principals (users, groups) in SharePoint's people picker UI component. It allows control over whether to exclude all users on tenant claim and whether the query is for a sharing scenario. It inherits from ClientValue, making it serializable for SharePoint API communication.

Source Code

class PeoplePickerQuerySettings(ClientValue):
    """Represents additional settings for the principal query."""

    def __init__(self, exclude_all_users_on_tenant_claim=None, is_sharing=None):
        """
        :param bool exclude_all_users_on_tenant_claim: Specifies whether the all users on tenant claim provider
            is excluded or not from the principal query.
        :param bool is_sharing: Specifies if the principal query is for sharing scenario or not.
        """
        self.ExcludeAllUsersOnTenantClaim = exclude_all_users_on_tenant_claim
        self.IsSharing = is_sharing

    @property
    def entity_type_name(self):
        return "SP.UI.ApplicationPages.PeoplePickerQuerySettings"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

exclude_all_users_on_tenant_claim: Boolean flag that determines whether the 'all users on tenant' claim provider should be excluded from the principal query results. When True, the query will not return the tenant-wide user claim. Can be None if not specified.

is_sharing: Boolean flag indicating whether this principal query is being performed in a sharing context (e.g., when sharing documents or sites with users). When True, the query behavior may be optimized for sharing scenarios. Can be None if not specified.

Return Value

Instantiation returns a PeoplePickerQuerySettings object with the specified configuration. The object can be serialized to JSON for use in SharePoint API calls. The entity_type_name property returns the string 'SP.UI.ApplicationPages.PeoplePickerQuerySettings' which identifies this object type in SharePoint's API.

Class Interface

Methods

__init__(exclude_all_users_on_tenant_claim=None, is_sharing=None)

Purpose: Initializes a new PeoplePickerQuerySettings instance with optional configuration parameters

Parameters:

  • exclude_all_users_on_tenant_claim: Optional boolean to exclude all users on tenant claim from query results
  • is_sharing: Optional boolean indicating if this is a sharing scenario query

Returns: None (constructor)

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type name for this settings object, used for API serialization and type identification

Returns: String 'SP.UI.ApplicationPages.PeoplePickerQuerySettings' representing the SharePoint entity type

Attributes

Name Type Description Scope
ExcludeAllUsersOnTenantClaim bool or None Stores whether to exclude the all users on tenant claim provider from the principal query. None indicates default behavior. instance
IsSharing bool or None Stores whether the principal query is for a sharing scenario. None indicates default behavior. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.sharepoint.ui.applicationpages.people_picker_query_settings import PeoplePickerQuerySettings

Usage Example

from office365.sharepoint.ui.applicationpages.people_picker_query_settings import PeoplePickerQuerySettings

# Create settings for a sharing scenario that excludes tenant-wide claims
settings = PeoplePickerQuerySettings(
    exclude_all_users_on_tenant_claim=True,
    is_sharing=True
)

# Create settings with default values
default_settings = PeoplePickerQuerySettings()

# Access the entity type name for API serialization
entity_type = settings.entity_type_name
print(entity_type)  # Output: SP.UI.ApplicationPages.PeoplePickerQuerySettings

# The settings object would typically be passed to a SharePoint people picker query method
# Example (pseudo-code):
# results = client_context.web.client_people_picker.query(search_text, settings)

Best Practices

  • This class is typically instantiated and passed to SharePoint people picker query methods rather than used standalone
  • Set exclude_all_users_on_tenant_claim=True when you want to prevent selecting all tenant users at once
  • Set is_sharing=True when the people picker is being used in a document/site sharing context to optimize query behavior
  • Both parameters are optional and can be left as None if default behavior is desired
  • The class inherits from ClientValue, which means it's designed to be serialized and sent to SharePoint REST API
  • Do not modify the entity_type_name property as it's used by SharePoint API for type identification
  • This is an immutable configuration object - create a new instance if different settings are needed

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class PickerSettings 81.6% similar

    Configuration settings class for the SharePoint client people picker control, providing access to picker behavior settings and query configurations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/picker_settings.py
  • class SharePointSharingSettings 75.2% similar

    A class representing SharePoint UI-specific sharing settings, providing access to people picker properties and other sharing-related configurations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/sharepoint_sharing_settings.py
  • class ClientPeoplePickerWebServiceInterface 71.4% similar

    A SharePoint web service interface class that provides static methods for querying and resolving principals (users, groups) using the People Picker functionality.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/web_service_interface.py
  • class PickerEntityInformation 67.9% similar

    A class representing additional information about a principal (user, group, or security entity) in SharePoint's people picker system.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/entity_information.py
  • class QueryConfiguration 65.4% similar

    A data class representing query configuration for a SharePoint local farm, encapsulating query context, parameters, routing information, and search endpoints.

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