class SearchObjectOwnerResult
A data class representing the owner of a search object in Microsoft Office 365 Search REST API, containing identifiers for tenant, site collection, and site.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/object_owner_result.py
4 - 19
simple
Purpose
This class encapsulates the ownership information for search objects in Office 365, providing a structured way to store and transmit tenant ID, site collection ID, and site ID that identify the owner of a search result. It inherits from ClientValue, making it compatible with the Office 365 REST API client framework for serialization and deserialization.
Source Code
class SearchObjectOwnerResult(ClientValue):
"""This object contains the search object owner in the result."""
def __init__(self, site_collection_id=None, site_id=None, tenant_id=None):
"""
:param str site_collection_id: This object contains the site collection id that identifies the owner.
:param str site_id: This object contains the site id that identifies the owner.
:param str tenant_id: This object contains the tenant id that identifies the owner
"""
self.SiteCollectionId = site_collection_id
self.SiteId = site_id
self.TenantId = tenant_id
@property
def entity_type_name(self):
return "Microsoft.Office.Server.Search.REST.SearchObjectOwnerResult"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
site_collection_id: Optional string parameter that specifies the unique identifier of the SharePoint site collection that owns the search object. Can be None if not applicable or unknown.
site_id: Optional string parameter that specifies the unique identifier of the SharePoint site that owns the search object. Can be None if not applicable or unknown.
tenant_id: Optional string parameter that specifies the unique identifier of the Office 365 tenant that owns the search object. Can be None if not applicable or unknown.
Return Value
Instantiation returns a SearchObjectOwnerResult object with three attributes (SiteCollectionId, SiteId, TenantId) set to the provided values or None. The entity_type_name property returns the string 'Microsoft.Office.Server.Search.REST.SearchObjectOwnerResult' which is used for API serialization.
Class Interface
Methods
__init__(self, site_collection_id=None, site_id=None, tenant_id=None)
Purpose: Initializes a new SearchObjectOwnerResult instance with optional owner identification parameters
Parameters:
site_collection_id: Optional string containing the site collection ID that identifies the ownersite_id: Optional string containing the site ID that identifies the ownertenant_id: Optional string containing the tenant ID that identifies the owner
Returns: None (constructor)
@property entity_type_name(self) -> str
property
Purpose: Returns the fully qualified entity type name used for Office 365 REST API serialization
Returns: String 'Microsoft.Office.Server.Search.REST.SearchObjectOwnerResult' representing the entity type
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
SiteCollectionId |
str or None | Stores the site collection ID that identifies the owner of the search object | instance |
SiteId |
str or None | Stores the site ID that identifies the owner of the search object | instance |
TenantId |
str or None | Stores the tenant ID that identifies the owner of the search object | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
# Create a search object owner result with all identifiers
owner_result = SearchObjectOwnerResult(
site_collection_id='12345678-1234-1234-1234-123456789abc',
site_id='87654321-4321-4321-4321-cba987654321',
tenant_id='abcdef12-3456-7890-abcd-ef1234567890'
)
# Access the attributes
print(owner_result.SiteCollectionId)
print(owner_result.SiteId)
print(owner_result.TenantId)
# Get the entity type name for API serialization
print(owner_result.entity_type_name)
# Create with partial information
partial_owner = SearchObjectOwnerResult(tenant_id='abcdef12-3456-7890-abcd-ef1234567890')
print(partial_owner.TenantId) # Set
print(partial_owner.SiteId) # None
Best Practices
- This is a data container class with no complex logic - instantiate it with the appropriate IDs when you need to represent search object ownership
- All constructor parameters are optional, allowing partial ownership information to be represented
- The class is immutable in practice - attributes are set during initialization and typically not modified afterward
- Use this class as part of Office 365 Search REST API responses to identify the owner of search results
- The entity_type_name property should not be overridden as it's used for proper API serialization
- When all parameters are None, the object represents an owner with no specific identification information
- This class inherits from ClientValue, which provides serialization capabilities for Office 365 REST API communication
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class PromotedResultsOperationsResult 68.0% similar
-
class CustomResult 67.4% similar
-
class ContextCondition 67.2% similar
-
class SearchResponse 66.4% similar
-
class GetTeamChannelSiteOwnerResponse 66.0% similar