🔍 Code Extractor

class SearchObjectOwnerResult

Maturity: 47

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.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/object_owner_result.py
Lines:
4 - 19
Complexity:
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 owner
  • site_id: Optional string containing the site ID that identifies the owner
  • tenant_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

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class PromotedResultsOperationsResult 68.0% similar

    A data class representing the result of a REST API call to retrieve promoted search results from SharePoint/Office 365.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/promoted_results_operations_result.py
  • class CustomResult 67.4% similar

    A data class representing custom search query results with layout templates and properties for Microsoft Office Server Search REST API.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/custom_result.py
  • class ContextCondition 67.2% similar

    A data class representing context conditions for a tenant in Microsoft Office Server Search REST API, containing properties for context condition type and source identifier.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/context_condition.py
  • class SearchResponse 66.4% similar

    A data class that encapsulates search query results and the search terms used to generate those results, inheriting from ClientValue for Office 365 API integration.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/response.py
  • class GetTeamChannelSiteOwnerResponse 66.0% similar

    A data transfer object representing the response from a SharePoint Portal API call to get team channel site owner information.

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