class ReportBase
ReportBase is a base class representing a report entity in Microsoft Office Server Search REST API, inheriting from ClientValue to provide client-side value representation.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/base.py
4 - 10
simple
Purpose
This class serves as a base model for search report entities in the Office 365 SharePoint Search REST API. It encapsulates farm-level reporting data and provides type identification for serialization/deserialization in REST API communications. The class is designed to be extended by more specific report types and integrates with the Office 365 client-side value system.
Source Code
class ReportBase(ClientValue):
def __init__(self, farm_id=None):
self.FarmId = farm_id
@property
def entity_type_name(self):
return "Microsoft.Office.Server.Search.REST.ReportBase"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
farm_id: Optional identifier for the SharePoint farm associated with this report. Can be None if not applicable or not yet assigned. This ID is used to scope the report to a specific farm deployment in multi-farm environments.
Return Value
Instantiation returns a ReportBase object with the specified farm_id. The entity_type_name property returns a string 'Microsoft.Office.Server.Search.REST.ReportBase' which identifies the entity type for REST API serialization.
Class Interface
Methods
__init__(self, farm_id=None)
Purpose: Initializes a new ReportBase instance with an optional farm identifier
Parameters:
farm_id: Optional farm identifier (default: None). Can be a string or any type representing a farm ID
Returns: None (constructor)
@property entity_type_name(self) -> str
property
Purpose: Returns the fully qualified entity type name for REST API serialization and type identification
Returns: String 'Microsoft.Office.Server.Search.REST.ReportBase' representing the entity type
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
FarmId |
Any (typically string or None) | Stores the farm identifier associated with this report. Can be None if not set or not applicable. Used to scope reports to specific SharePoint farm deployments. | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
class ReportBase(ClientValue):
def __init__(self, farm_id=None):
self.FarmId = farm_id
@property
def entity_type_name(self):
return "Microsoft.Office.Server.Search.REST.ReportBase"
# Create a report instance without farm_id
report = ReportBase()
print(report.FarmId) # None
print(report.entity_type_name) # Microsoft.Office.Server.Search.REST.ReportBase
# Create a report instance with farm_id
report_with_farm = ReportBase(farm_id="farm-123")
print(report_with_farm.FarmId) # farm-123
# Modify farm_id after instantiation
report.FarmId = "farm-456"
print(report.FarmId) # farm-456
Best Practices
- This is a base class intended to be extended by specific report types rather than used directly in most cases
- The FarmId attribute can be set during initialization or modified later as needed
- The entity_type_name property should not be overridden unless creating a derived class with a different entity type
- Ensure proper inheritance from ClientValue is maintained when extending this class
- The class follows Office 365 naming conventions with PascalCase for attributes (FarmId)
- This class is stateless and immutable in terms of behavior, making it safe for concurrent use
- When extending this class, maintain the entity_type_name pattern for proper REST API integration
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class Entity 66.3% similar
-
class SiteSharingReportStatus 65.8% similar
-
class SiteSharingReportCapabilities 64.5% similar
-
class ReportTopQueries 63.1% similar
-
class BaseGptResponse 62.5% similar